Skip to content

Commit

Permalink
isso/init: Log paths at start, error if not found
Browse files Browse the repository at this point in the history
  • Loading branch information
ix5 committed May 1, 2022
1 parent ec30b46 commit 50b58be
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion isso/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
import logging
import tempfile

from os.path import dirname, join
from os.path import abspath, dirname, exists, join
from argparse import ArgumentParser
from functools import partial, reduce

Expand Down Expand Up @@ -177,6 +177,9 @@ class App(Isso, uWSGIMixin):

isso = App(conf)

logger.info("Using database at '%s'",
abspath(isso.conf.get('general', 'dbpath')))

if not any(conf.getiter("general", "host")):
logger.error("No website(s) configured, Isso won't work.")
sys.exit(1)
Expand Down Expand Up @@ -238,6 +241,16 @@ def main():
subparser.add_parser("run", help="run server")

args = parser.parse_args()

if not args.conf:
logger.info("No configuration file specified. Using defaults.")
else:
if not exists(args.conf):
logger.error("Specified config '%s' does not exist! Exiting.",
abspath(args.conf))
sys.exit(1)
logger.info("Using configuration file '%s'", abspath(args.conf))

conf = config.load(config.default_file(), args.conf)

if args.command == "import":
Expand Down

0 comments on commit 50b58be

Please sign in to comment.