feature #1112: Fix wrong paths in tm_ssh/mv remote copy

This commit is contained in:
Jaime Melis committed 2012-03-12 19:11:33 +01:00
1 parent 78dfdd2503
commit 46776157a3
3 files changed
+5 -4

No files matched your search

+1 -2
View File
@@ -327,9 +327,8 @@ function iqn_get_vg_name {
function iqn_get_host {
IQN="$1"
TARGET=`echo "$IQN"|$CUT -d: -f2`
LV_NAME=$(iqn_get_lv_name "$IQN")
VG_NAME=$(iqn_get_vg_name "$IQN")
echo ${TARGET%%.$VG_NAME.$LV_NAME}
}
-1
View File
@@ -110,7 +110,6 @@ if is_iscsi "$DST_HOST"; then
set -e
mkdir -p $DST_DIR
$SUDO $(iscsiadm_discovery "$TARGET_HOST")
$SUDO $(iscsiadm_discovery "$TARGET_HOST")
$SUDO $(iscsiadm_login "$IQN" "$TARGET_HOST")
sleep 1
DISK_BY_PATH=\$(ls /dev/disk/by-path/*$IQN-lun-1)
+4 -1
View File
@@ -44,6 +44,9 @@ DST_HOST=`arg_host $DST`
DST_DIR=`dirname $DST_PATH`
SRC_DS_DIR=`dirname $SRC_PATH`
SRC_VM_DIR=`basename $SRC_PATH`
if [ `is_disk $DST_PATH` -eq 1 ]; then
exit 0
fi
@@ -60,7 +63,7 @@ log "Moving $SRC to $DST"
ssh_exec_and_log "$DST_HOST" "rm -rf '$DST_PATH'" \
"Error removing target path to prevent overwrite errors"
TAR_COPY="$SSH $SRC_HOST '$TAR -C $SRC_PATH/.. -cf - .'"
TAR_COPY="$SSH $SRC_HOST '$TAR -C $SRC_DS_DIR -cf - $SRC_VM_DIR'"
TAR_COPY="$TAR_COPY | $SSH $DST_HOST '$TAR -C $DST_DIR -xf -'"
exec_and_log "eval $TAR_COPY" "Error copying disk directory to target host"