1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B #4781: Rollback for ssh, shared and qcow2

This commit is contained in:
Jaime Melis 2016-10-06 17:11:31 +02:00
parent 9d90f12602
commit ab9dfbcb51
2 changed files with 11 additions and 4 deletions

View File

@ -359,10 +359,10 @@ EOF`
function ssh_exec_and_log
{
ssh_exec_and_log_no_error "$@"
rc=$?
EXEC_RC=$?
if [ $rc !=0 ]; then
exit $rc
if [ "$EXEC_RC" != "0" ]; then
exit $EXEC_RC
fi
}

View File

@ -54,9 +54,16 @@ ssh_make_path $DST_HOST $DST_DIR
MKFS_CMD=`mkfs_command $DST_PATH $FSTYPE $SIZE`
MKSCRIPT=$(cat <<EOF
set -e -o pipefail
export PATH=/usr/sbin:/sbin:\$PATH
$MKFS_CMD
rc=\$?
if [ "\$rc" != "0" ]; then
rm -f $DST_PATH
fi
exit \$rc
EOF
)