Merge pull request #618 from Unrud/config_file_wsgi

Fail when config file doesn't exist in WSGI and FCGI scripts
This commit is contained in:
Unrud 2017-06-01 12:55:53 +02:00 committed by GitHub
commit 43ac218243
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 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")) filename = os.path.expanduser(configuration.get("logging", "config"))
debug = configuration.getboolean("logging", "debug") debug = configuration.getboolean("logging", "debug")
logger = log.start("radicale", filename, debug) logger = log.start("radicale", filename, debug)

View File

@ -25,7 +25,10 @@ import os
from radicale import Application, config, log 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")) filename = os.path.expanduser(configuration.get("logging", "config"))
debug = configuration.getboolean("logging", "debug") debug = configuration.getboolean("logging", "debug")
logger = log.start("radicale", filename, debug) logger = log.start("radicale", filename, debug)