mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
tm_nfs now fixes urls that point to VM_DIR remotelly
git-svn-id: http://svn.opennebula.org/one/trunk@894 3034c82b-c49b-4eb3-8279-a7acafdc01c0
This commit is contained in:
parent
cbc442949f
commit
8fe27e0f48
@ -28,9 +28,13 @@ fi
|
||||
|
||||
. $TMCOMMON
|
||||
|
||||
get_vmdir
|
||||
|
||||
SRC_PATH=`arg_path $SRC`
|
||||
DST_PATH=`arg_path $DST`
|
||||
|
||||
fix_paths
|
||||
|
||||
log "$1 $2"
|
||||
log "DST: $DST_PATH"
|
||||
|
||||
|
@ -38,8 +38,12 @@ fi
|
||||
|
||||
. $TMCOMMON
|
||||
|
||||
get_vmdir
|
||||
|
||||
DST_PATH=`arg_path $DST`
|
||||
|
||||
fix_dst_path
|
||||
|
||||
DST_DIR=`dirname $DST_PATH`
|
||||
ISO_DIR=$DST_DIR/isofiles
|
||||
|
||||
|
@ -28,7 +28,11 @@ fi
|
||||
|
||||
. $TMCOMMON
|
||||
|
||||
get_vmdir
|
||||
|
||||
SRC_PATH=`arg_path $SRC`
|
||||
|
||||
fix_src_path
|
||||
|
||||
log "Deleting $SRC_PATH"
|
||||
exec_and_log "rm -rf $SRC_PATH"
|
||||
|
@ -28,9 +28,13 @@ fi
|
||||
|
||||
. $TMCOMMON
|
||||
|
||||
get_vmdir
|
||||
|
||||
SRC_PATH=`arg_path $SRC`
|
||||
DST_PATH=`arg_path $DST`
|
||||
|
||||
fix_dst_path
|
||||
|
||||
DST_DIR=`dirname $DST_PATH`
|
||||
|
||||
log "Creating directory $DST_DIR"
|
||||
|
@ -25,11 +25,16 @@ fi
|
||||
|
||||
. $TMCOMMON
|
||||
|
||||
get_vmdir
|
||||
|
||||
SIZE=$1
|
||||
FSTYPE=$2
|
||||
DST=$3
|
||||
|
||||
DST_PATH=`arg_path $DST`
|
||||
|
||||
fix_dst_path
|
||||
|
||||
DST_DIR=`dirname $DST_PATH`
|
||||
|
||||
exec_and_log "mkdir -p $DST_DIR"
|
||||
|
@ -28,7 +28,12 @@ fi
|
||||
|
||||
. $TMCOMMON
|
||||
|
||||
get_vmdir
|
||||
|
||||
DST_PATH=`arg_path $DST`
|
||||
|
||||
fix_dst_path
|
||||
|
||||
DST_DIR=`dirname $DST_PATH`
|
||||
|
||||
log "Creating directory $DST_DIR"
|
||||
|
@ -30,9 +30,13 @@ fi
|
||||
|
||||
. $TMCOMMON
|
||||
|
||||
get_vmdir
|
||||
|
||||
SRC_PATH=`arg_path $SRC`
|
||||
DST_PATH=`arg_path $DST`
|
||||
|
||||
fix_paths
|
||||
|
||||
if [ "$SRC_PATH" == "$DST_PATH" ]; then
|
||||
log "Will not move, source and destination are equal"
|
||||
else
|
||||
|
@ -15,6 +15,41 @@
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
if [ -z "$ONE_LOCATION" ]; then
|
||||
ONE_CONF=/etc/one/oned.conf
|
||||
ONE_LOCAL_VAR=/var/lib/one
|
||||
else
|
||||
ONE_CONF=$ONE_LOCATION/etc/oned.conf
|
||||
ONE_LOCAL_VAR=$ONE_LOCATION/var
|
||||
fi
|
||||
|
||||
function get_vmdir
|
||||
{
|
||||
VMDIR=`cat $ONE_CONF | grep ^VM_DIR= | cut -d= -f2`
|
||||
}
|
||||
|
||||
function fix_paths
|
||||
{
|
||||
if [ -n "$VMDIR" ]; then
|
||||
SRC_PATH=${SRC_PATH/$VMDIR/$ONE_LOCAL_VAR}
|
||||
DST_PATH=${DST_PATH/$VMDIR/$ONE_LOCAL_VAR}
|
||||
fi
|
||||
}
|
||||
|
||||
function fix_src_path
|
||||
{
|
||||
if [ -n "$VMDIR" ]; then
|
||||
SRC_PATH=${SRC_PATH/$VMDIR/$ONE_LOCAL_VAR}
|
||||
fi
|
||||
}
|
||||
|
||||
function fix_dst_path
|
||||
{
|
||||
if [ -n "$VMDIR" ]; then
|
||||
DST_PATH=${DST_PATH/$VMDIR/$ONE_LOCAL_VAR}
|
||||
fi
|
||||
}
|
||||
|
||||
# Used for log messages
|
||||
SCRIPT_NAME=`basename $0`
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user