Browse code

Add error handling for euch.sh volume creation

Error handling for volume creation calls die with the appropriate
message.

Change-Id: Ib095992384edf895aaf78cb4115702d6a0675a3f
Closes-Bug: #1206180

twm2016 authored on 2016/02/27 02:44:57
Showing 1 changed files
... ...
@@ -17,7 +17,6 @@ set -o errexit
17 17
 # an error.  It is also useful for following allowing as the install occurs.
18 18
 set -o xtrace
19 19
 
20
-
21 20
 # Settings
22 21
 # ========
23 22
 
... ...
@@ -89,7 +88,8 @@ if is_service_enabled c-vol && ! is_service_enabled n-cell && [ "$VIRT_DRIVER" !
89 89
     VOLUME_ZONE=`euca-describe-availability-zones | head -n1 | cut -f2`
90 90
     die_if_not_set $LINENO VOLUME_ZONE "Failure to find zone for volume"
91 91
 
92
-    VOLUME=`euca-create-volume -s 1 -z $VOLUME_ZONE | cut -f2`
92
+    VOLUME=`euca-create-volume -s 1 -z $VOLUME_ZONE` || die $LINENO "Failure to create volume"
93
+    VOLUME=`echo "$VOLUME" | cut -f2`
93 94
     die_if_not_set $LINENO VOLUME "Failure to create volume"
94 95
 
95 96
     # Test that volume has been created