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

M #3460: Move same dir check below ssh_make_path (#131)

(cherry picked from commit 45e0126b87470ee7a0686e1b74e84be3d206d3f3)
This commit is contained in:
Jan Orel 2020-07-30 11:06:03 +02:00 committed by Ruben S. Montero
parent f8b9c5be35
commit c0d0f17d97
No known key found for this signature in database
GPG Key ID: A0CEA6FA880A1D87

View File

@ -60,13 +60,6 @@ if [ `is_disk $DST_PATH` -eq 1 ]; then
exit 0
fi
RANDOM_FILE=$(ssh "$DST_HOST" "mktemp -p \"$DST_DIR\"")
trap "ssh $DST_HOST \"rm -f $RANDOM_FILE\"" EXIT TERM INT HUP
if ssh "$SRC_HOST" "test -f $RANDOM_FILE"; then
log "Not moving $SRC to $DST, they are the same path"
exit 0
fi
if [ `lcm_state` -eq 60 ]; then
log "Not moving files from $SRC_HOST in FT mode"
exit 0
@ -84,6 +77,13 @@ MONITOR=$(ssh_monitor_and_log "$SRC_HOST" "$MONITOR_CMD" 'Get .monitor')
ssh_make_path "$DST_HOST" "$DST_PATH" "$MONITOR"
RANDOM_FILE=$(ssh "$DST_HOST" "mktemp -p \"$DST_DIR\"")
trap "ssh $DST_HOST \"rm -f $RANDOM_FILE\"" EXIT TERM INT HUP
if ssh "$SRC_HOST" "test -f $RANDOM_FILE"; then
log "Not moving $SRC to $DST, they are the same path"
exit 0
fi
log "Moving $SRC to $DST"
ssh_exec_and_log "$DST_HOST" "rm -rf '$DST_PATH'" \