From 282bcda6df580a87a333bb92e44f0434ef3d61ec Mon Sep 17 00:00:00 2001 From: Albert Snow Date: Fri, 10 Jan 2025 15:59:25 -0600 Subject: [PATCH] fix loading of fence config --- fence/__init__.py | 6 ------ fence/config.py | 5 +++++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/fence/__init__.py b/fence/__init__.py index 59066e14c..1bab83020 100755 --- a/fence/__init__.py +++ b/fence/__init__.py @@ -20,12 +20,6 @@ # Load the configuration *before* importing modules that rely on it from fence.config import config, get_SQLAlchemyDriver from fence.settings import CONFIG_SEARCH_FOLDERS - -config.load( - config_path=os.environ.get("FENCE_CONFIG_PATH"), - search_folders=CONFIG_SEARCH_FOLDERS, -) - from fence.auth import logout, build_redirect_url from fence.metrics import metrics from fence.blueprints.data.indexd import S3IndexedFileLocation diff --git a/fence/config.py b/fence/config.py index 43293c3fa..42b9e8a9b 100644 --- a/fence/config.py +++ b/fence/config.py @@ -10,6 +10,7 @@ from fence.errors import NotFound from fence.utils import log_backoff_retry, log_backoff_giveup, exception_do_not_retry, logger +from fence.settings import CONFIG_SEARCH_FOLDERS logger = get_logger(__name__) @@ -173,6 +174,10 @@ def _validate_parent_child_studies(dbgap_configs): config = FenceConfig(DEFAULT_CFG_PATH) +config.load( + config_path=os.environ.get("FENCE_CONFIG_PATH"), + search_folders=CONFIG_SEARCH_FOLDERS, +) # Default settings to control usage of backoff library. DEFAULT_BACKOFF_SETTINGS = {