refactor: moved func accounts to dedicated deployment dir

This commit is contained in:
2025-02-07 10:58:16 +01:00
parent 1684860db8
commit 0daf1ff3bd
3 changed files with 6 additions and 1 deletions

View File

@ -54,7 +54,8 @@ class MongoDBDatasource:
Load the functional accounts to the database.
"""
functional_accounts_file = os.path.join(
os.path.dirname(__file__), ".functional_accounts.json"
os.path.dirname(os.path.dirname(os.path.dirname(__file__))),
"deployment/.functional_accounts.json",
)
if not os.path.exists(functional_accounts_file):
raise FileNotFoundError(

View File

@ -17,6 +17,10 @@ def load_env() -> dict:
current_dir = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
env_file = os.path.join(current_dir, ".env.yaml")
if not os.path.exists(env_file):
# check if there is an env file in the deployment directory
env_file = os.path.join(os.path.dirname(os.path.dirname(__file__)), "deployment/.env.yaml")
if not os.path.exists(env_file):
raise FileNotFoundError(f"Could not find .env file in {os.getcwd()} or {current_dir}")