clean.sh updates
* Clean out data, log and state dirs
* Include lib/apache to clear is_apache_enabled_service not found error
* Clean errors removing tgt config files
* Clean errors removing VG backing file in lib/cinder
Change-Id: I33dfde17eb8daaaed7f7e76337fe6a8085a266bf
diff --git a/lib/cinder b/lib/cinder
index cbe732e..45a9a25 100644
--- a/lib/cinder
+++ b/lib/cinder
@@ -109,8 +109,8 @@
# of the backing file
if [ -z "`sudo lvs --noheadings -o lv_name $vg`" ]; then
# if the backing physical device is a loop device, it was probably setup by devstack
- VG_DEV=$(sudo losetup -j $DATA_DIR/${vg}-backing-file | awk -F':' '/backing-file/ { print $1}')
- if [[ -n "$VG_DEV" ]]; then
+ if [[ -n "$VG_DEV" ]] && [[ -e "$VG_DEV" ]]; then
+ VG_DEV=$(sudo losetup -j $DATA_DIR/${vg}-backing-file | awk -F':' '/backing-file/ { print $1}')
sudo losetup -d $VG_DEV
rm -f $DATA_DIR/${vg}-backing-file
fi