diff --git a/lib/galaxy/web/stack/__init__.py b/lib/galaxy/web/stack/__init__.py index 458e768dbf5..6d92d45741d 100644 --- a/lib/galaxy/web/stack/__init__.py +++ b/lib/galaxy/web/stack/__init__.py @@ -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'):