From 206f98989698df72626a314eef01852d2c38bd59 Mon Sep 17 00:00:00 2001
From: Sebastian Rieger <sebastian.rieger@informatik.hs-fulda.de>
Date: Tue, 15 Sep 2015 22:31:18 +0200
Subject: [PATCH] fixed typo in existing image check, bumped version

---
 create-cumulusvx-image/create-cumulus-vx-image.sh | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)

diff --git a/create-cumulusvx-image/create-cumulus-vx-image.sh b/create-cumulusvx-image/create-cumulus-vx-image.sh
index c77a5d4..f7bcaac 100644
--- a/create-cumulusvx-image/create-cumulus-vx-image.sh
+++ b/create-cumulusvx-image/create-cumulus-vx-image.sh
@@ -1,10 +1,11 @@
 #!/bin/bash
-# create-cumulus-vx-image.sh V0.2
+# create-cumulus-vx-image.sh V0.3
 # HS-Fulda - sebastian.rieger@informatik.hs-fulda.de
 #
 # changelog:
 #
-# V0.2		- added support to delete existing image with the same name and generating the default nova flavor
+# V0.2    added support to delete existing image with the same name and generating the default nova flavor
+# V0.3    checking whether it is safe to unmount the working directory
 
 # usage
 if [ ! $# -eq 2 ] ; then
@@ -46,14 +47,17 @@ function safe_unmount() {
 }
 
 # check for an existing image with the same name and offer to delete it prior to creating a new one
-CHECK_FOR_EXISTING_IMAGE=$(glance image-show CumulusVX 2>&1)
+CHECK_FOR_EXISTING_IMAGE=$(glance image-show $GLANCE_IMAGE_NAME 2>&1)
 if [ $? == 0 ] ; then
+  glance image-show $GLANCE_IMAGE_NAME
+  echo
+  echo
   read -r -p "There is already an image with the same name in glance. Do you want to overwrite it? [y/N] " RESPONSE
   if [[ $RESPONSE =~ ^([yY][eE][sS]|[yY])$ ]] ; then
-    echo "Deleting existing image $2..."
+    echo "Deleting existing image $GLANCE_IMAGE_NAME..."
     echo "==========================================================="
 
-    glance image-delete $2
+    glance image-delete $GLANCE_IMAGE_NAME
   else
     echo "An image with the same name already exists. Either delete this image or choose another name."
     exit 1
-- 
GitLab