CLOUDSTACK-1340: Exit script if exporting fails for any disk format Signed-off-by: Rohit Yadav <[email protected]>
Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/b55f5898 Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/b55f5898 Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/b55f5898 Branch: refs/heads/marvin-refactor Commit: b55f5898d536b27034643684a42885996a821c66 Parents: 20e2617 Author: Rohit Yadav <[email protected]> Authored: Fri Mar 1 21:00:26 2013 +0530 Committer: Rohit Yadav <[email protected]> Committed: Fri Mar 1 21:02:04 2013 +0530 ---------------------------------------------------------------------- tools/appliance/build.sh | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/b55f5898/tools/appliance/build.sh ---------------------------------------------------------------------- diff --git a/tools/appliance/build.sh b/tools/appliance/build.sh index f479e5a..caa3805 100644 --- a/tools/appliance/build.sh +++ b/tools/appliance/build.sh @@ -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
