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
This commit is contained in:
twm2016 2016-02-26 11:44:57 -06:00
parent 447af8f3f6
commit 5fe81c50a2

View File

@ -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