mirror of
https://github.com/Kozea/Radicale.git
synced 2025-04-03 21:27:36 +03:00
detect active default config
This commit is contained in:
parent
28fa28aaff
commit
c7c3119267
2 changed files with 13 additions and 2 deletions
|
@ -53,9 +53,14 @@ def _get_application_instance(config_path: str, wsgi_errors: types.ErrorStream
|
|||
config_path))
|
||||
log.set_level(cast(str, configuration.get("logging", "level")))
|
||||
# Log configuration after logger is configured
|
||||
default_config_active = True
|
||||
for source, miss in configuration.sources():
|
||||
logger.info("%s %s", "Skipped missing" if miss
|
||||
logger.info("%s %s", "Skipped missing/unreadable" if miss
|
||||
else "Loaded", source)
|
||||
if not miss and source != "default config":
|
||||
default_config_active = False
|
||||
if default_config_active:
|
||||
logger.warn("%s", "No config file found/readable - only default config is active")
|
||||
_application_instance = Application(configuration)
|
||||
if _application_config_path != config_path:
|
||||
raise ValueError("RADICALE_CONFIG must not change: %r != %r" %
|
||||
|
|
|
@ -167,8 +167,14 @@ def run() -> None:
|
|||
log.set_level(cast(str, configuration.get("logging", "level")))
|
||||
|
||||
# Log configuration after logger is configured
|
||||
default_config_active = True
|
||||
for source, miss in configuration.sources():
|
||||
logger.info("%s %s", "Skipped missing" if miss else "Loaded", source)
|
||||
logger.info("%s %s", "Skipped missing/unreadable" if miss else "Loaded", source)
|
||||
if not miss and source != "default config":
|
||||
default_config_active = False
|
||||
|
||||
if default_config_active:
|
||||
logger.warn("%s", "No config file found/readable - only default config is active")
|
||||
|
||||
if args_ns.verify_storage:
|
||||
logger.info("Verifying storage")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue