Bug #4235: SSH transfer drivers fail on epilogs with persistent images

(cherry picked from commit 360a2bc8c4)
This commit is contained in:
Jaime Melis committed 2015-12-11 12:13:05 +01:00
1 parent 531da5a1db
commit 408bd49042
1 file changed
+5 -12
+5 -12
View File
@@ -48,18 +48,11 @@ DST_SNAP="${DST}.snap"
# Move the image back to the datastore
#-------------------------------------------------------------------------------
CPSCRIPT=$(cat <<EOF
set -ex
$SCP -r "${SRC_PATH}" "${DST}"
if [ -d "${SRC_PATH_SNAP}" ]; then
rsync -r --delete "${SRC_PATH_SNAP}/" "${DST_SNAP}"
fi
EOF
)
log "Moving $SRC to datastore as $DST"
ssh_exec_and_log "${SRC_HOST}" "${CPSCRIPT}" "Error copying $SRC to $DST"
exec_and_log "$SCP -r $SRC $DST" "Error copying $SRC to $DST"
if $SSH $SRC_HOST ls ${SRC_PATH_SNAP} >/dev/null 2>&1; then
exec_and_log "rsync -r --delete ${SRC_HOST}:${SRC_PATH_SNAP}/ ${DST_SNAP}"
fi
exit 0