From 7b2beb604ee87851073cad704a4e3c00c7058864 Mon Sep 17 00:00:00 2001 From: Vasyl Saienko Date: Thu, 19 May 2016 16:14:14 +0300 Subject: [PATCH] Move all cleanups to cleanup_ironic stop_ironic is called during upgrade process and it should not clean any Ironic files, as they will be used after upgrade. This patch moves cleaning ironic http configuration and qemu hooks to cleanup_ironic function. Co-Authored-By: Vladyslav Drok Change-Id: I45f2d23eb1e182a87fb41a79a3a7b7527948bf35 --- devstack/lib/ironic | 27 ++++++++++++++++----------- devstack/plugin.sh | 2 +- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/devstack/lib/ironic b/devstack/lib/ironic index 1cd180da8f..3ddb6c48f9 100644 --- a/devstack/lib/ironic +++ b/devstack/lib/ironic @@ -357,13 +357,26 @@ function _config_ironic_apache_wsgi { enable_apache_site ironic } -# cleanup_ironic() - Remove residual data files, anything left over from previous -# runs that would need to clean up. -function cleanup_ironic { +# cleanup_ironic_config_files() - Remove residual cache/config/log files, +# left over from previous runs that would need to clean up. +function cleanup_ironic_config_files { sudo rm -rf $IRONIC_AUTH_CACHE_DIR $IRONIC_CONF_DIR sudo rm -rf $IRONIC_VM_LOG_DIR/* } +# cleanup_ironic() - Clean everything left from Ironic +function cleanup_ironic { + cleanup_ironic_config_files + + # Cleanup the WSGI files + if [[ "$IRONIC_IPXE_ENABLED" == "True" ]] ; then + _cleanup_ironic_apache_wsgi + fi + + # Remove the hook to disable log rotate + sudo rm -rf $IRONIC_LIBVIRT_HOOKS_PATH/qemu +} + # configure_ironic_dirs() - Create all directories required by Ironic and # associated services. function configure_ironic_dirs { @@ -651,14 +664,6 @@ function start_ironic_conductor { function stop_ironic { stop_process ir-api stop_process ir-cond - - # Cleanup the WSGI files - if [[ "$IRONIC_IPXE_ENABLED" == "True" ]] ; then - _cleanup_ironic_apache_wsgi - fi - - # Remove the hook to disable log rotate - sudo rm -rf $IRONIC_LIBVIRT_HOOKS_PATH/qemu } # create_ovs_taps is also called by the devstack/upgrade/resources.sh script diff --git a/devstack/plugin.sh b/devstack/plugin.sh index 5c6c9cb5ad..f10358ba58 100644 --- a/devstack/plugin.sh +++ b/devstack/plugin.sh @@ -16,7 +16,7 @@ if is_service_enabled ir-api ir-cond; then echo_summary "Installing Ironic" install_ironic install_ironicclient - cleanup_ironic + cleanup_ironic_config_files elif [[ "$2" == "post-config" ]]; then # stack/post-config - Called after the layer 1 and 2 services have been