Skip to content

Commit 40b433f

Browse files
committed
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
1 parent d7c9d2e commit 40b433f

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

unstack.sh

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -189,11 +189,13 @@ if [[ -n "$SCREEN" ]]; then
189189
fi
190190
fi
191191

192-
# BUG: maybe it doesn't exist? We should isolate this further down.
193192
# NOTE: Cinder automatically installs the lvm2 package, independently of the
194-
# enabled backends. So if Cinder is enabled, we are sure lvm (lvremove,
195-
# /etc/lvm/lvm.conf, etc.) is here.
196-
if is_service_enabled cinder; then
193+
# enabled backends. So if Cinder is enabled, and installed successfully we are
194+
# sure lvm2 (lvremove, /etc/lvm/lvm.conf, etc.) is here.
195+
if is_service_enabled cinder && is_package_installed lvm2; then
196+
# Using /bin/true here indicates a BUG - maybe the
197+
# DEFAULT_VOLUME_GROUP_NAME doesn't exist? We should
198+
# isolate this further down in lib/cinder cleanup.
197199
clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME || /bin/true
198200
clean_lvm_filter
199201
fi

0 commit comments

Comments
 (0)