from requests import get as rget from __init__ import LOGGER import os CONFIG_FILE_URL = os.environ.get('CONFIG_FILE_URL') try: if len(CONFIG_FILE_URL) == 0: raise TypeError try: res = rget(CONFIG_FILE_URL) if res.status_code == 200: with open('config.env', 'wb+') as f: f.write(res.content) else: LOGGER.error(f"Failed to download config.env {res.status_code}") except Exception as e: LOGGER.error(f"CONFIG_FILE_URL: {e}") except: pass