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:
parent
9d90f12602
commit
ab9dfbcb51
@ -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
|
||||
}
|
||||
|
||||
|
@ -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
|
||||
)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user