summaryrefslogtreecommitdiff
path: root/nova/api
diff options
context:
space:
mode:
authorSean Mooney <work@seanmooney.info>2022-11-08 15:00:22 +0000
committerBalazs Gibizer <gibi@redhat.com>2022-12-07 12:36:32 +0100
commit73fe84fa0ea6f7c7fa55544f6bce5326d87743a6 (patch)
treeb9bbcc2b2eb315cf911f5359372f5076811f5fa0 /nova/api
parentc97507dfcd57cce9d76670d3b0d48538900c00e9 (diff)
downloadnova-73fe84fa0ea6f7c7fa55544f6bce5326d87743a6.tar.gz
Support multiple config file with mod_wsgi
Unlike uwsgi, apache mod_wsgi does not support passing commandline arguments to the python wsgi script it invokes. As a result while you can pass --config-file when hosting the api and metadata wsgi applications with uwsgi there is no way to use multiple config files with mod_wsgi. This change mirrors how this is supported in keystone today by intoducing a new OS_NOVA_CONFIG_FILES env var to allow operators to optional pass a ';' delimited list of config files to load. This change also add docs for this env var and the existing undocumented OS_NOVA_CONFIG_DIR. Closes-Bug: 1994056 Change-Id: I8e3ccd75cbb7f2e132b403cb38022787c2c0a37b
Diffstat (limited to 'nova/api')
-rw-r--r--nova/api/openstack/wsgi_app.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/nova/api/openstack/wsgi_app.py b/nova/api/openstack/wsgi_app.py
index d60069ce84..6a2b72a611 100644
--- a/nova/api/openstack/wsgi_app.py
+++ b/nova/api/openstack/wsgi_app.py
@@ -42,8 +42,11 @@ def _get_config_files(env=None):
if env is None:
env = os.environ
dirname = env.get('OS_NOVA_CONFIG_DIR', '/etc/nova').strip()
+ files = env.get('OS_NOVA_CONFIG_FILES', '').split(';')
+ if files == ['']:
+ files = CONFIG_FILES
return [os.path.join(dirname, config_file)
- for config_file in CONFIG_FILES]
+ for config_file in files]
def _setup_service(host, name):