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