From 5fe81c50a2606b9763676e40b4a1083c5a72e58a Mon Sep 17 00:00:00 2001 From: twm2016 Date: Fri, 26 Feb 2016 11:44:57 -0600 Subject: [PATCH] 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 --- exercises/euca.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/exercises/euca.sh b/exercises/euca.sh index c2957e222b..60e7d8ca29 100755 --- a/exercises/euca.sh +++ b/exercises/euca.sh @@ -17,7 +17,6 @@ set -o errexit # an error. It is also useful for following allowing as the install occurs. set -o xtrace - # Settings # ======== @@ -89,7 +88,8 @@ if is_service_enabled c-vol && ! is_service_enabled n-cell && [ "$VIRT_DRIVER" ! VOLUME_ZONE=`euca-describe-availability-zones | head -n1 | cut -f2` die_if_not_set $LINENO VOLUME_ZONE "Failure to find zone for volume" - VOLUME=`euca-create-volume -s 1 -z $VOLUME_ZONE | cut -f2` + VOLUME=`euca-create-volume -s 1 -z $VOLUME_ZONE` || die $LINENO "Failure to create volume" + VOLUME=`echo "$VOLUME" | cut -f2` die_if_not_set $LINENO VOLUME "Failure to create volume" # Test that volume has been created