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 <vdrok@mirantis.com>

Change-Id: I45f2d23eb1e182a87fb41a79a3a7b7527948bf35
This commit is contained in:
Vasyl Saienko 2016-05-19 16:14:14 +03:00 committed by John L. Villalovos
parent 8cb87b0c99
commit 7b2beb604e
2 changed files with 17 additions and 12 deletions

View File

@ -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

View File

@ -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