diff --git a/heat/api/cfn/wsgi.py b/heat/api/cfn/wsgi.py index 108e95ec66..a7d1f99f3a 100644 --- a/heat/api/cfn/wsgi.py +++ b/heat/api/cfn/wsgi.py @@ -37,7 +37,8 @@ def init_application(): # already contain registered options if the app is reloaded. CONF.reset() logging.register_options(CONF) - CONF(project='heat', + CONF(args=[], + project='heat', prog='heat-api-cfn', version=version.version_info.version_string()) logging.setup(CONF, CONF.prog) diff --git a/heat/api/openstack/wsgi.py b/heat/api/openstack/wsgi.py index ef2cfb64af..db247ddebb 100644 --- a/heat/api/openstack/wsgi.py +++ b/heat/api/openstack/wsgi.py @@ -38,7 +38,7 @@ def init_application(): CONF.reset() logging.register_options(CONF) version = hversion.version_info.version_string() - CONF(project='heat', prog='heat-api', version=version) + CONF(args=[], project='heat', prog='heat-api', version=version) logging.setup(CONF, CONF.prog) config.set_config_defaults() messaging.setup() diff --git a/releasenotes/notes/fix-wsgi-init-args-empty-9d86398edce73f54.yaml b/releasenotes/notes/fix-wsgi-init-args-empty-9d86398edce73f54.yaml new file mode 100644 index 0000000000..4b99103dab --- /dev/null +++ b/releasenotes/notes/fix-wsgi-init-args-empty-9d86398edce73f54.yaml @@ -0,0 +1,11 @@ +--- +fixes: + - | + Fixed an issue where ``heat-api`` and ``heat-api-cfn``, when running + under uWSGI with ``wsgi-file``, could fail to load the WSGI application + with ``unable to load app 0 ... (callable not found or import error)``. + The ``init_application`` functions in ``heat.api.openstack.wsgi`` and + ``heat.api.cfn.wsgi`` invoked ``oslo.config`` without ``args=[]``, so + ``oslo.config`` fell back to ``sys.argv[1:]`` and rejected uWSGI's own + arguments (e.g. ``--ini``) with ``SystemExit(2)``. The calls now pass + an explicit empty argument list.