From d5182ce3fcf5caf8f7dca84217b2c3cb70993df7 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Fri, 19 Apr 2024 12:27:14 +0100 Subject: [PATCH] lib/apache: Pass name, not path, to remove_uwsgi_config We'd like to move from configuring uWSGI with '.wsgi' files to configuring with module paths. Do this for all in-tree services and log a deprecation warning for anyone still passing a path. Note that since 'basepath foo' returns 'foo', this is effectively a no-op for the services being converted here. Change-Id: Ia1ad5ff160a9821ceab97ff1c24bc48cd4bf1d6f Signed-off-by: Stephen Finucane --- lib/apache | 6 ++++++ lib/cinder | 2 +- lib/glance | 2 +- lib/keystone | 2 +- lib/neutron | 2 +- lib/nova | 4 ++-- lib/placement | 2 +- 7 files changed, 13 insertions(+), 7 deletions(-) diff --git a/lib/apache b/lib/apache index a314b76fb7..48438da6a1 100644 --- a/lib/apache +++ b/lib/apache @@ -402,8 +402,14 @@ function remove_uwsgi_config { local conf=$1 local wsgi=$2 local name="" + # TODO(stephenfin): Remove this call when everyone is using module path + # configuration instead of file path configuration name=$(basename $wsgi) + if [[ "$wsgi" = /* ]]; then + deprecated "Passing a wsgi script to remove_uwsgi_config is deprecated, pass an application name instead" + fi + rm -rf $conf disable_apache_site $name } diff --git a/lib/cinder b/lib/cinder index f7824eb6f4..ae898e9522 100644 --- a/lib/cinder +++ b/lib/cinder @@ -275,7 +275,7 @@ function cleanup_cinder { fi stop_process "c-api" - remove_uwsgi_config "$CINDER_UWSGI_CONF" "$CINDER_UWSGI" + remove_uwsgi_config "$CINDER_UWSGI_CONF" "cinder-wsgi" } # configure_cinder() - Set config files, create data dirs, etc diff --git a/lib/glance b/lib/glance index 8ee842625f..274687112e 100644 --- a/lib/glance +++ b/lib/glance @@ -168,7 +168,7 @@ function cleanup_glance { # Cleanup reserved stores directories sudo rm -rf $GLANCE_STAGING_DIR $GLANCE_TASKS_DIR fi - remove_uwsgi_config "$GLANCE_UWSGI_CONF" "$GLANCE_UWSGI" + remove_uwsgi_config "$GLANCE_UWSGI_CONF" "glance-wsgi-api" } # Set multiple cinder store related config options for each of the cinder store diff --git a/lib/keystone b/lib/keystone index 6cb4aac46a..7d6b05fd41 100644 --- a/lib/keystone +++ b/lib/keystone @@ -150,7 +150,7 @@ function cleanup_keystone { sudo rm -f $(apache_site_config_for keystone) else stop_process "keystone" - remove_uwsgi_config "$KEYSTONE_PUBLIC_UWSGI_CONF" "$KEYSTONE_PUBLIC_UWSGI" + remove_uwsgi_config "$KEYSTONE_PUBLIC_UWSGI_CONF" "keystone-wsgi-public" sudo rm -f $(apache_site_config_for keystone-wsgi-public) fi } diff --git a/lib/neutron b/lib/neutron index bc77f161d7..ed854fdd66 100644 --- a/lib/neutron +++ b/lib/neutron @@ -823,7 +823,7 @@ function cleanup_neutron { if [ "$NEUTRON_DEPLOY_MOD_WSGI" == "True" ]; then stop_process neutron-api stop_process neutron-rpc-server - remove_uwsgi_config "$NEUTRON_UWSGI_CONF" "$NEUTRON_BIN_DIR/neutron-api" + remove_uwsgi_config "$NEUTRON_UWSGI_CONF" "neutron-api" sudo rm -f $(apache_site_config_for neutron-api) fi diff --git a/lib/nova b/lib/nova index a261fac8f6..ee3f29eebf 100644 --- a/lib/nova +++ b/lib/nova @@ -248,8 +248,8 @@ function cleanup_nova { stop_process "n-api" stop_process "n-api-meta" - remove_uwsgi_config "$NOVA_UWSGI_CONF" "$NOVA_UWSGI" - remove_uwsgi_config "$NOVA_METADATA_UWSGI_CONF" "$NOVA_METADATA_UWSGI" + remove_uwsgi_config "$NOVA_UWSGI_CONF" "nova-api" + remove_uwsgi_config "$NOVA_METADATA_UWSGI_CONF" "nova-metadata" if [[ "$NOVA_BACKEND" == "LVM" ]]; then clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME diff --git a/lib/placement b/lib/placement index c6bf99f868..63fdfb6c1a 100644 --- a/lib/placement +++ b/lib/placement @@ -68,7 +68,7 @@ function is_placement_enabled { # runs that a clean run would need to clean up function cleanup_placement { sudo rm -f $(apache_site_config_for placement-api) - remove_uwsgi_config "$PLACEMENT_UWSGI_CONF" "$PLACEMENT_UWSGI" + remove_uwsgi_config "$PLACEMENT_UWSGI_CONF" "placement-api" } # _config_placement_apache_wsgi() - Set WSGI config files