diff --git a/src/datastore_mad/remotes/vmfs/clone b/src/datastore_mad/remotes/vmfs/clone index e7ea970e13..1e07f26a16 100755 --- a/src/datastore_mad/remotes/vmfs/clone +++ b/src/datastore_mad/remotes/vmfs/clone @@ -59,17 +59,18 @@ DS_ID="${XPATH_ELEMENTS[2]}" SRC="${XPATH_ELEMENTS[3]}" SRC_FOLDER=`basename $SRC` +set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK" + +DST=`generate_image_path` +DST_FOLDER=`basename $DST` +DST_HOST=`get_destination_host $(dirname $0)` + if [ "$SSH" != "yes" ]; then USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3)` PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3)` VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD" fi -set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK" - -DST=`generate_image_path` -DST_FOLDER=`basename $DST` - # ------------ Copy the image to the repository ------------- log "Copying local image $SRC to the image repository" diff --git a/src/datastore_mad/remotes/vmfs/cp b/src/datastore_mad/remotes/vmfs/cp index 5d8bc21167..b5b9441a5f 100755 --- a/src/datastore_mad/remotes/vmfs/cp +++ b/src/datastore_mad/remotes/vmfs/cp @@ -70,7 +70,7 @@ SHA1="${XPATH_ELEMENTS[6]}" set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK" DST=`generate_image_path` -DST_HOST=`get_destination_host` +DST_HOST=`get_destination_host $(dirname $0)` if [ "$SSH" != "yes" ]; then USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3)` diff --git a/src/datastore_mad/remotes/vmfs/mkfs b/src/datastore_mad/remotes/vmfs/mkfs index 3f03dc58aa..0abb8df4c0 100755 --- a/src/datastore_mad/remotes/vmfs/mkfs +++ b/src/datastore_mad/remotes/vmfs/mkfs @@ -69,7 +69,7 @@ set_up_datastore "$BASE_PATH" "$RESTRICTED_DIRS" "$SAFE_DIRS" "$UMASK" DST=`generate_image_path` DST_DIR=`dirname $DST` DST_FOLDER_NAME=`basename $DST` -DST_HOST=`get_destination_host` +DST_HOST=`get_destination_host $(dirname $0)` if [ "$SSH" != "yes" ]; then USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3)` diff --git a/src/datastore_mad/remotes/vmfs/rm b/src/datastore_mad/remotes/vmfs/rm index 6a5b4cb279..c1904f1bbf 100755 --- a/src/datastore_mad/remotes/vmfs/rm +++ b/src/datastore_mad/remotes/vmfs/rm @@ -54,7 +54,7 @@ done < <($XPATH /DS_DRIVER_ACTION_DATA/IMAGE/SOURCE \ SRC="${XPATH_ELEMENTS[0]}" DS_NAME="${XPATH_ELEMENTS[1]}" -DST_HOST=`get_destination_host` +DST_HOST=`get_destination_host $(dirname $0)` FOLDER_TO_ERASE=`dirname SRC` if [ "$SSH" != "yes" ]; then