CLOUDSTACK-1340: Exit script if exporting fails for any disk format

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2013-03-01 21:00:26 +05:30
parent 20e2617f46
commit b55f5898d5
1 changed files with 4 additions and 2 deletions

View File

@ -17,7 +17,6 @@
# under the License.
set -x
set -e
appliance="systemvmtemplate"
build_date=`date +%Y-%m-%d`
@ -42,9 +41,9 @@ done
machine_uuid=`vboxmanage showvminfo $appliance | grep UUID | head -1 | awk '{print $2}'`
hdd_uuid=`vboxmanage showvminfo $appliance | grep vdi | head -1 | awk '{print $8}' | cut -d ')' -f 1`
hdd_path=`vboxmanage list hdds | grep $appliance | grep vdi | cut -c 14-`
shared_folders=`vboxmanage showvminfo $appliance | grep Name | grep Host`
# Remove any shared folder
shared_folders=`vboxmanage showvminfo $appliance | grep Name | grep Host`
while [ "$shared_folders" != "" ]
do
vboxmanage sharedfolder remove systemvmtemplate --name "`echo $shared_folders | head -1 | cut -c 8- | cut -d \' -f 1`"
@ -58,6 +57,9 @@ vboxmanage modifyhd $hdd_uuid --compact
rm -fr dist *.ova *.vhd *.vdi *.qcow* *.bz2
mkdir dist
# Exit shell if exporting fails for any format
set -e
# Export for Xen
vboxmanage internalcommands converttoraw "$hdd_path" img.raw
faketime '2010-01-01' vhd-util convert -s 0 -t 1 -i img.raw -o stagefixed.vhd