Check if cinder is enabled before doing anything lvm2 related

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
This commit is contained in:
Jordan Pittier 2015-05-29 11:38:22 +02:00
parent a1774b5704
commit 23bf045c18

View File

@ -187,5 +187,10 @@ if [[ -n "$SCREEN" ]]; then
fi
# BUG: maybe it doesn't exist? We should isolate this further down.
clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME || /bin/true
clean_lvm_filter
# 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
clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME || /bin/true
clean_lvm_filter
fi