From bd2f6a860f402a8ae27fd0a481ceb5f9dc3d5881 Mon Sep 17 00:00:00 2001 From: Davanum Srinivas Date: Wed, 16 Aug 2017 22:51:07 -0400 Subject: [PATCH] Fix Cleanups for keystone/placement/nova * Check KEYSTONE_DEPLOY flag and cleanup appropriately * When we stop process, we should not wipe uwsgi config we should remove files only on cleanup * We should not call cleanup *BEFORE* configure, we are just wiping out the uwsgi ini files * cleanup_placement should be called from clean.sh Change-Id: I066f5f87ff22d7da2e3814f8c2de75f2af625d2b --- clean.sh | 1 + lib/keystone | 25 ++++++++++++------------- stack.sh | 2 -- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/clean.sh b/clean.sh index 9ffe3bee6b..2333596c1f 100755 --- a/clean.sh +++ b/clean.sh @@ -88,6 +88,7 @@ cleanup_cinder || /bin/true cleanup_glance cleanup_keystone cleanup_nova +cleanup_placement cleanup_neutron cleanup_swift cleanup_horizon diff --git a/lib/keystone b/lib/keystone index 1061081a5e..15728297ac 100644 --- a/lib/keystone +++ b/lib/keystone @@ -148,16 +148,18 @@ function is_keystone_enabled { # cleanup_keystone() - Remove residual data files, anything left over from previous # runs that a clean run would need to clean up function cleanup_keystone { - # TODO: remove admin at pike-2 - # These files will be created if we are running WSGI_MODE="uwsgi" - remove_uwsgi_config "$KEYSTONE_PUBLIC_UWSGI_CONF" "$KEYSTONE_PUBLIC_UWSGI" - remove_uwsgi_config "$KEYSTONE_ADMIN_UWSGI_CONF" "$KEYSTONE_ADMIN_UWSGI" - sudo rm -f $(apache_site_config_for keystone-wsgi-public) - sudo rm -f $(apache_site_config_for keystone-wsgi-admin) - - # These files will be created if we are running WSGI_MODE="mod_wsgi" - disable_apache_site keystone - sudo rm -f $(apache_site_config_for keystone) + if [ "$KEYSTONE_DEPLOY" == "mod_wsgi" ]; then + # These files will be created if we are running WSGI_MODE="mod_wsgi" + disable_apache_site keystone + sudo rm -f $(apache_site_config_for keystone) + else + stop_process "keystone" + # TODO: remove admin at pike-2 + remove_uwsgi_config "$KEYSTONE_PUBLIC_UWSGI_CONF" "$KEYSTONE_PUBLIC_UWSGI" + remove_uwsgi_config "$KEYSTONE_ADMIN_UWSGI_CONF" "$KEYSTONE_ADMIN_UWSGI" + sudo rm -f $(apache_site_config_for keystone-wsgi-public) + sudo rm -f $(apache_site_config_for keystone-wsgi-admin) + fi } # _config_keystone_apache_wsgi() - Set WSGI config files of Keystone @@ -582,9 +584,6 @@ function stop_keystone { restart_apache_server else stop_process keystone - remove_uwsgi_config "$KEYSTONE_PUBLIC_UWSGI_CONF" "$KEYSTONE_PUBLIC_UWSGI" - # TODO(remove in at pike-2) - remove_uwsgi_config "$KEYSTONE_ADMIN_UWSGI_CONF" "$KEYSTONE_ADMIN_UWSGI" fi # Kill the Keystone screen window stop_process key diff --git a/stack.sh b/stack.sh index 015ee6ec43..f984c8bb89 100755 --- a/stack.sh +++ b/stack.sh @@ -896,14 +896,12 @@ fi if is_service_enabled nova; then # Compute service stack_install_service nova - cleanup_nova configure_nova fi if is_service_enabled placement; then # placement api stack_install_service placement - cleanup_placement configure_placement fi