diff --git a/isso/dispatch.py b/isso/dispatch.py index d8c80a7..6cd3974 100644 --- a/isso/dispatch.py +++ b/isso/dispatch.py @@ -2,7 +2,6 @@ import sys import os -import os.path import logging from glob import glob @@ -47,19 +46,19 @@ class Dispatcher(DispatcherMiddleware): resp = Response("\n".join(self.isso.keys()), 404, content_type="text/plain") return resp(environ, start_response) -settings = os.environ.get("ISSO_SETTINGS") +settings = os.environ.get("ISSO_SETTINGS") if settings: if os.path.isdir(settings): - conf_glob = os.path.join(os.environ["ISSO_SETTINGS"], '*.cfg') + conf_glob = os.path.join(settings, '*.cfg') confs = glob(conf_glob) application = wsgi.SubURI(Dispatcher(*confs)) else: - confs = os.environ["ISSO_SETTINGS"].split(";") + confs = settings.split(";") for path in confs: if not os.path.isfile(path): logger.fatal("%s: no such file", path) sys.exit(1) application = wsgi.SubURI(Dispatcher(*confs)) else: - logger.fatal('environment variable ISSO_SETTINGS or ISSO_SETTINGS_DIR must be set') + logger.fatal('environment variable ISSO_SETTINGS must be set')