From 8adb096de290bc239037ecb6140a447986475b93 Mon Sep 17 00:00:00 2001 From: Guillaume Ayoub Date: Tue, 4 Jun 2013 15:12:06 +0200 Subject: [PATCH] Fix the warning if the configuration file is not found --- radicale/__main__.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/radicale/__main__.py b/radicale/__main__.py index ebddbc1..1218bf1 100644 --- a/radicale/__main__.py +++ b/radicale/__main__.py @@ -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):