Browse code

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

Clay Gerrard authored on 2016/09/01 18:07:12
Showing 1 changed files
... ...
@@ -189,11 +189,13 @@ if [[ -n "$SCREEN" ]]; then
189 189
     fi
190 190
 fi
191 191
 
192
-# BUG: maybe it doesn't exist? We should isolate this further down.
193 192
 # 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.
197 199
     clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME || /bin/true
198 200
     clean_lvm_filter
199 201
 fi