On some system Cinder is not enabled so we can't assume LVM is installed. So
do not try to `sed` /etc/lvm/lvm.conf or clean LVM VG if cinder is not enabled
Change-Id: I09b1a7bee0785e5e1bb7dc96158a654bd3f15c83
| ... | ... |
@@ -187,5 +187,10 @@ if [[ -n "$SCREEN" ]]; then |
| 187 | 187 |
fi |
| 188 | 188 |
|
| 189 | 189 |
# BUG: maybe it doesn't exist? We should isolate this further down. |
| 190 |
-clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME || /bin/true |
|
| 191 |
-clean_lvm_filter |
|
| 190 |
+# NOTE: Cinder automatically installs the lvm2 package, independently of the |
|
| 191 |
+# enabled backends. So if Cinder is enabled, we are sure lvm (lvremove, |
|
| 192 |
+# /etc/lvm/lvm.conf, etc.) is here. |
|
| 193 |
+if is_service_enabled cinder; then |
|
| 194 |
+ clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME || /bin/true |
|
| 195 |
+ clean_lvm_filter |
|
| 196 |
+fi |