Fail when config file doesn't exist in WSGI and FCGI scripts

This commit is contained in:
Unrud 2017-06-01 12:26:33 +02:00
parent 91e49986ee
commit f971ca0262
2 changed files with 8 additions and 2 deletions

View File

@ -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)

View File

@ -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)