Skip to content

Commit

Permalink
Merge pull request #608 from Unrud/config_file
Browse files Browse the repository at this point in the history
Fail if config file is not found
  • Loading branch information
liZe authored May 26, 2017
2 parents e4af3fc + d2a17c3 commit 1825c35
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions radicale/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,12 @@ def run():
group.add_argument(*args, **kwargs)

args = parser.parse_args()
if args.config:
if args.config is not None:
configuration = config.load()
configuration_found = configuration.read(args.config)
if args.config:
configuration_found = configuration.read(args.config)
else:
configuration_found = True
else:
configuration_paths = [
"/etc/radicale/config",
Expand All @@ -101,7 +104,8 @@ def run():

# Log a warning if the configuration file of the command line is not found
if not configuration_found:
logger.warning("Configuration file '%s' not found" % args.config)
logger.error("Configuration file '%s' not found" % args.config)
exit(1)

try:
serve(configuration, logger)
Expand Down

0 comments on commit 1825c35

Please sign in to comment.