diff --git a/scripts/storage/secondary/createtmplt.sh b/scripts/storage/secondary/createtmplt.sh index a2d296332df..3f81e5b81d2 100755 --- a/scripts/storage/secondary/createtmplt.sh +++ b/scripts/storage/secondary/createtmplt.sh @@ -147,7 +147,6 @@ if [ -n "$cksum" ] then verify_cksum $cksum $tmpltimg fi - tmpltimg2=$(uncompress $tmpltimg) rollback_if_needed $tmpltfs $? "failed to uncompress $tmpltimg\n" @@ -156,10 +155,10 @@ rollback_if_needed $tmpltfs $? "tar archives not supported\n" if [ ${tmpltname%.vhd} != ${tmpltname} ] then - if which vhd-util 2>/dev/null + if which vhd-util &>/dev/null then vhd-util check -n ${tmpltimg2} > /dev/null - rollback_if_needed $tmpltfs $? "vhd tool check $tmpltimg2 failed\n" + rollback_if_needed $tmpltfs $? "vhd check of $tmpltimg2 failed\n" fi fi diff --git a/scripts/storage/secondary/installrtng.sh b/scripts/storage/secondary/installrtng.sh index b31234cfa20..fbb9b89b205 100755 --- a/scripts/storage/secondary/installrtng.sh +++ b/scripts/storage/secondary/installrtng.sh @@ -89,6 +89,7 @@ mkdir -p $destdir if [ $? -ne 0 ] then printf "Failed to write to mount point $mntpoint -- is it mounted?\n" + exit 3 fi if [ "$Fflag" == "1" ] @@ -120,6 +121,7 @@ touch $tmpfile if [ $? -ne 0 ] then printf "Failed to create temporary file in directory $(dirname $0) -- is it read-only or full?\n" + exit 4 fi if [ "$uflag" == "1" ] @@ -139,15 +141,17 @@ then if [ $? -ne 0 ] then printf "Failed to create temporary file in directory $(dirname $0) -- is it read-only or full?\n" + exit 6 fi fi -$(dirname $0)/createtmplt.sh -s 2 -d 'SystemVM Template' -n $localfile -t $destdir/ -f $tmpfile -u &> /dev/null +installrslt=$($(dirname $0)/createtmplt.sh -s 2 -d 'SystemVM Template' -n $localfile -t $destdir/ -f $tmpfile -u) if [ $? -ne 0 ] then - echo "Failed to install system vm template $tmpltimg to $destdir" + echo "Failed to install system vm template $tmpltimg to $destdir: $installrslt" + exit 7 fi if [ "$ext" == "ova" ]