Fix devstack cleanup when using amphorav2

When cleaning up a devstack environment with amphorav2 enabled,
./clean.sh might fail because redis has already been stopped and
uninstalled.
This commit move the stop_redis step to the octavia_stop step and
ensures that stopping redis doesn't fail.

Change-Id: I987535e90cbf13917c50c5905c64b614188928ec
(cherry picked from commit 5d470357ec)
(cherry picked from commit 168f1a1212)
(cherry picked from commit 5d49484eb6)
This commit is contained in:
Gregory Thiemonge 2021-03-25 07:45:35 +01:00 committed by Carlos Goncalves
parent 19619ce888
commit 8829f0fbbe

View File

@ -249,6 +249,10 @@ function install_redis {
pip_install_gr redis pip_install_gr redis
} }
function stop_redis {
stop_service redis || true
}
function uninstall_redis { function uninstall_redis {
if is_fedora; then if is_fedora; then
uninstall_package redis uninstall_package redis
@ -258,8 +262,6 @@ function uninstall_redis {
uninstall_package redis uninstall_package redis
fi fi
stop_service redis
pip_unistall redis pip_unistall redis
} }
@ -629,6 +631,10 @@ function octavia_stop {
else else
die "Unknown network controller. Please define octavia_delete_network_interface_device" die "Unknown network controller. Please define octavia_delete_network_interface_device"
fi fi
if [[ ${OCTAVIA_ENABLE_AMPHORAV2_PROVIDER} == True ]]; then
stop_redis
fi
} }
function octavia_cleanup { function octavia_cleanup {