Fix for None config_file in web stack stuff.

This commit is contained in:
John Chilton
2017-12-06 20:28:21 -05:00
parent f5aa17df18
commit 8cd23970fb
+3 -2
View File
@@ -194,8 +194,9 @@ class UWSGIApplicationStack(MessageApplicationStack):
# application was loaded with --ini-paste, so we can make some assumptions, most notably, uWSGI does not have
# any way to set the app name when loading with paste.deploy:loadapp(), so hardcoding the alternate section
# name to `app:main` is fine.
if ((config_file is None and uwsgi_opt.get("ini") or uwsgi_opt.get("ini-paste"))
or has_ext(config_file, "ini", aliases=True, ignore="sample")):
has_ini_config = config_file is None and uwsgi_opt.get("ini") or uwsgi_opt.get("ini-paste")
has_ini_config = has_ini_config or (config_file and has_ext(config_file, "ini", aliases=True, ignore="sample"))
if has_ini_config:
config_file = config_file or uwsgi_opt.get("ini") or uwsgi_opt.get("ini-paste")
parser = nice_config_parser(config_file)
if not parser.has_section(config_section) and parser.has_section('app:main'):