diff options
| -rw-r--r-- | kerbana/__init__.py | 11 | 
1 files changed, 11 insertions, 0 deletions
diff --git a/kerbana/__init__.py b/kerbana/__init__.py index 7e30c2d..cef433f 100644 --- a/kerbana/__init__.py +++ b/kerbana/__init__.py @@ -20,6 +20,11 @@ def create_app(test_config: Optional[config.Config] = None):              )          except FileNotFoundError:              app.logger.debug("File /etc/kerbana/kerbana.toml not found.") +        else: +            app.logger.debug( +                "Loaded configuration from /etc/kerbana/kerbana.toml" +            ) +          try:              app.config.from_file(                  os.path.join( @@ -31,6 +36,9 @@ def create_app(test_config: Optional[config.Config] = None):              )          except FileNotFoundError:              app.logger.debug("File kerbana.toml not found.") +        else: +            app.logger.debug("Loaded configuration from kerbana.toml") +          try:              app.config.from_envvar("KERBANA_CONFIG")          except RuntimeError as e: @@ -41,6 +49,9 @@ def create_app(test_config: Optional[config.Config] = None):                      os.environ["KERBANA_CONFIG"]                  )              ) +        else: +            app.logger.debug("Loaded configuration from $KERBANA_CONFIG") +          app.config.from_prefixed_env(prefix="KERBANA_")      else:          app.config.from_object(test_config)  | 
