from configs.logging import logger import os from app.common.minio import minio_client def get_kerberos_to_local(uri: str): file_name = uri.split("/")[-1] kerberos_exists = os.path.exists('./assets/kerberos') if not kerberos_exists: os.makedirs('./assets/kerberos') f_exists = os.path.exists('./assets/kerberos/'+file_name) if not f_exists: res = minio_client.get_file(uri) with open('./assets/kerberos/'+file_name,'wb') as f: f.write(res) logger.info(f'{file_name}不存在, 已通过minio下载至本地')