Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions isso/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ class App(Isso, uWSGIMixin):

isso = App(conf)

if not any(conf.getiter("general", "host")):
logger.error("No website(s) configured, Isso won't work.")
sys.exit(1)

# check HTTP server connection
for host in conf.getiter("general", "host"):
with http.curl('HEAD', host, '/', 5) as resp:
Expand Down Expand Up @@ -260,10 +264,6 @@ def main():
logger.propagate = False
logging.getLogger("werkzeug").propagate = False

if not any(conf.getiter("general", "host")):
logger.error("No website(s) configured, Isso won't work.")
sys.exit(1)

if conf.get("server", "listen").startswith("http://"):
host, port, _ = urlsplit(conf.get("server", "listen"))
try:
Expand Down
9 changes: 9 additions & 0 deletions isso/run.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
# -*- encoding: utf-8 -*-

import os
import sys
import pkg_resources

from isso import config, make_app

# Mock make_app because it is run by pytest
# with the --doctest-modules flag
# which will fail because make_app will exit
# without valid configuration
# https://stackoverflow.com/a/44595269/1279355
if "pytest" in sys.modules:
make_app = lambda config, multiprocessing: True # noqa

application = make_app(
config.load(
pkg_resources.resource_filename('isso', 'defaults.ini'),
Expand Down