From 23bf045c183f53762e7771fe0081b3d4ab09e107 Mon Sep 17 00:00:00 2001 From: Jordan Pittier Date: Fri, 29 May 2015 11:38:22 +0200 Subject: [PATCH] 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 --- unstack.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/unstack.sh b/unstack.sh index f0da9710a2..10e595809a 100755 --- a/unstack.sh +++ b/unstack.sh @@ -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