From f971ca026295aec489bb0cb8e8b718af2da7227a Mon Sep 17 00:00:00 2001 From: Unrud Date: Thu, 1 Jun 2017 12:26:33 +0200 Subject: [PATCH] Fail when config file doesn't exist in WSGI and FCGI scripts --- radicale.fcgi | 5 ++++- radicale.wsgi | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/radicale.fcgi b/radicale.fcgi index d92df28..591afb0 100755 --- a/radicale.fcgi +++ b/radicale.fcgi @@ -31,7 +31,10 @@ from flup.server.fcgi import WSGIServer from radicale import Application, config, log -configuration = config.load([os.environ.get("RADICALE_CONFIG")]) +config_paths = [] +if os.environ.get("RADICALE_CONFIG"): + config_paths.append(os.environ["RADICALE_CONFIG"]) +configuration = config.load(config_paths, ignore_missing_paths=False) filename = os.path.expanduser(configuration.get("logging", "config")) debug = configuration.getboolean("logging", "debug") logger = log.start("radicale", filename, debug) diff --git a/radicale.wsgi b/radicale.wsgi index bc829a5..dbbd02c 100755 --- a/radicale.wsgi +++ b/radicale.wsgi @@ -25,7 +25,10 @@ import os from radicale import Application, config, log -configuration = config.load([os.environ.get("RADICALE_CONFIG")]) +config_paths = [] +if os.environ.get("RADICALE_CONFIG"): + config_paths.append(os.environ["RADICALE_CONFIG"]) +configuration = config.load(config_paths, ignore_missing_paths=False) filename = os.path.expanduser(configuration.get("logging", "config")) debug = configuration.getboolean("logging", "debug") logger = log.start("radicale", filename, debug)