Fix the warning if the configuration file is not found

This commit is contained in:
Guillaume Ayoub 2013-06-04 15:12:06 +02:00
parent 61d063c610
commit 8adb096de2

View File

@ -84,10 +84,8 @@ def run():
options = parser.parse_args()[0]
# Read in the configuration specified by the command line (if specified)
if options.config:
if not config.read(options.config):
log.LOGGER.warning(
"Configuration file '%s' not found" % options.config)
configuration_found = (
config.read(options.config) if options.config else True)
# Update Radicale configuration according to options
for option in parser.option_list:
@ -100,6 +98,11 @@ def run():
# Start logging
log.start()
# Log a warning if the configuration file of the command line is not found
if not configuration_found:
log.LOGGER.warning(
"Configuration file '%s' not found" % options.config)
# Fork if Radicale is launched as daemon
if options.daemon:
if options.pid and os.path.exists(options.pid):