From 40b433fb07d2612075a30e2e18fbae094c2c8ec0 Mon Sep 17 00:00:00 2001 From: Clay Gerrard Date: Thu, 1 Sep 2016 02:07:12 -0700 Subject: [PATCH] Make unstack.sh more independently deterministic In some initialization conditions (having never ran stack.sh) the result of unstack.sh is dependent on if the user had previously installed lvm2 or disabled the cinder service. This change makes all results the same with a bit of LBYL. There's also a drive-by to put a comment back where it belongs after being accidentally moved in the related change. Related-Change: I09b1a7bee0785e5e1bb7dc96158a654bd3f15c83 Change-Id: I9a7e052677d60cbbbdd582877f3c6c48c387f668 Closes-Bug: #1619195 --- unstack.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/unstack.sh b/unstack.sh index d93b8353db..f888896cb9 100755 --- a/unstack.sh +++ b/unstack.sh @@ -189,11 +189,13 @@ if [[ -n "$SCREEN" ]]; then fi fi -# BUG: maybe it doesn't exist? We should isolate this further down. # NOTE: Cinder automatically installs the lvm2 package, independently of the -# enabled backends. So if Cinder is enabled, we are sure lvm (lvremove, -# /etc/lvm/lvm.conf, etc.) is here. -if is_service_enabled cinder; then +# enabled backends. So if Cinder is enabled, and installed successfully we are +# sure lvm2 (lvremove, /etc/lvm/lvm.conf, etc.) is here. +if is_service_enabled cinder && is_package_installed lvm2; then + # Using /bin/true here indicates a BUG - maybe the + # DEFAULT_VOLUME_GROUP_NAME doesn't exist? We should + # isolate this further down in lib/cinder cleanup. clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME || /bin/true clean_lvm_filter fi