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
This commit is contained in:
Clay Gerrard 2016-09-01 02:07:12 -07:00
parent d7c9d2e27e
commit 40b433fb07

View File

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