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

bug: persistent images can not be moved because they are the same

This commit is contained in:
Ruben S. Montero 2011-05-15 01:13:01 +02:00
parent 8fbc6a8207
commit a044828c0d
2 changed files with 6 additions and 2 deletions

View File

@ -54,8 +54,11 @@ http://*)
*)
log "Moving local image $SRC to the image repository"
exec_and_log "mv -f $SRC $DST" \
"Could not move $SRC to $DST"
if [ \( -L $SRC \) -a \( "`$READLINK $SRC`" = "$DST" \) ] ; then
log "Not moving files to image repo, they are the same"
else
exec_and_log "mv -f $SRC $DST" "Could not move $SRC to $DST"
fi
;;
esac

View File

@ -32,6 +32,7 @@ SED=/bin/sed
SSH=/usr/bin/ssh
SUDO=/usr/bin/sudo
WGET=/usr/bin/wget
READLINK=/bin/readlink
# Used for log messages
SCRIPT_NAME=`basename $0`