From 44fb209f08fa6f02e31bf5e8cf8c58443dfb694f Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Thu, 22 Mar 2012 18:01:24 +0100 Subject: [PATCH] feature #1112: remove debugging comments --- src/tm_mad/iscsi/delete | 2 -- src/tm_mad/iscsi/ln | 26 ++++++-------------------- src/tm_mad/iscsi/mv | 11 ----------- src/tm_mad/iscsi/mvds | 6 +++--- src/tm_mad/tm_common.sh | 3 +++ 5 files changed, 12 insertions(+), 36 deletions(-) diff --git a/src/tm_mad/iscsi/delete b/src/tm_mad/iscsi/delete index fb4a4fbd0c..229600c893 100755 --- a/src/tm_mad/iscsi/delete +++ b/src/tm_mad/iscsi/delete @@ -54,6 +54,4 @@ else ssh_exec_and_log "$DST_HOST" "rm -rf $DST_PATH" "Error deleting $DST_PATH" fi -ssh_exec_and_log "$DST_HOST" "$DISCOVER_CMD" \ - "Error registering $DST_HOST:$DEV" exit 0 diff --git a/src/tm_mad/iscsi/ln b/src/tm_mad/iscsi/ln index 9aeb9def20..5a9ea3dd92 100755 --- a/src/tm_mad/iscsi/ln +++ b/src/tm_mad/iscsi/ln @@ -22,8 +22,8 @@ # - host is the target host to deploy the VM # - remote_system_ds is the path for the system datastore in the host -SRC=$1 # iqn.2012-02.org.opennebula:o200.vg-one.lv-one-0 -DST=$2 # o202:/var/lib/one//datastores/0/0/disk.0 +SRC=$1 +DST=$2 if [ -z "${ONE_LOCATION}" ]; then TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh @@ -38,10 +38,10 @@ fi #------------------------------------------------------------------------------- IQN=$SRC -TARGET=`arg_path $SRC` # o200.vg-one.lv-one-0 -DST_PATH=`arg_path $DST` # /var/lib/one/datastores/0/0/disk.0 -DST_HOST=`arg_host $DST` # o202 -DST_DIR=`dirname $DST_PATH` # /var/lib/one/datastores/0/0 +TARGET=`arg_path $SRC` +DST_PATH=`arg_path $DST` +DST_HOST=`arg_host $DST` +DST_DIR=`dirname $DST_PATH` BASE_IQN=`echo $IQN|$CUT -d: -f1` TARGET=`echo $IQN|$CUT -d: -f2` @@ -64,17 +64,3 @@ EOF ssh_exec_and_log "$DST_HOST" "$DISCOVER_CMD" \ "Error registering $DST_HOST:$DEV" exit 0 - - -# case $SRC in -# http://*) -# log "Downloading $SRC" -# RMT_CMD="$WGET -O $DST_PATH $SRC" -# ssh_exec_and_log "$DST_HOST" "$RMT_CMD" "Error downloading $SRC" -# ;; - -# *) -# log "Cloning $SRC in $DST_PATH" -# exec_and_log "$SCP $SRC $DST" "Error copying $SRC to $DST" -# ;; -# esac diff --git a/src/tm_mad/iscsi/mv b/src/tm_mad/iscsi/mv index 21cc55bdd2..1b2fa09f75 100755 --- a/src/tm_mad/iscsi/mv +++ b/src/tm_mad/iscsi/mv @@ -24,7 +24,6 @@ SRC=$1 DST=$2 - if [ -z "${ONE_LOCATION}" ]; then TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh else @@ -37,16 +36,6 @@ DRIVER_PATH=$(dirname $0) source ${DRIVER_PATH}/../../datastore/iscsi/iscsi.conf -# {:path=> -# "/var/lib/one/remotes/tm/iscsi/mv o202:/var/lib/one//datastores/0/3/disk.0 rama:/var/lib/one/datastores/0/3/disk.0", -# :result=>"SUCCESS", -# :info=>"-"} - -# {:path=> -# "/var/lib/one/remotes/tm/shared/mv o202:/var/lib/one//datastores/0/3 rama:/var/lib/one/datastores/0/3", -# :result=>"SUCCESS", -# :info=>"-"} - #------------------------------------------------------------------------------- # Return if moving a disk, we will move them when moving the whole system_ds # directory for the VM diff --git a/src/tm_mad/iscsi/mvds b/src/tm_mad/iscsi/mvds index 325442c645..5e42a50213 100755 --- a/src/tm_mad/iscsi/mvds +++ b/src/tm_mad/iscsi/mvds @@ -22,8 +22,8 @@ # - host is the target host to deploy the VM # - remote_system_ds is the path for the system datastore in the host -SRC=$1 # o202:/var/lib/one//datastores/0/1/disk.0 -DST=$2 # iqn.2012-02.org.opennebula:o200.vg-one.lv-one-0 +SRC=$1 +DST=$2 if [ -z "${ONE_LOCATION}" ]; then TMCOMMON=/var/lib/one/remotes/tm/tm_common.sh @@ -33,7 +33,7 @@ fi . $TMCOMMON -SRC_HOST=`arg_host $SRC` # o202 +SRC_HOST=`arg_host $SRC` IQN=$DST log "Logging out $IQN" diff --git a/src/tm_mad/tm_common.sh b/src/tm_mad/tm_common.sh index 4aeeb7ad84..e9d970aa72 100644 --- a/src/tm_mad/tm_common.sh +++ b/src/tm_mad/tm_common.sh @@ -33,6 +33,9 @@ ONE_SH=$ONE_LIB/sh . $ONE_SH/scripts_common.sh +# Set umask +umask 0007 + # ------------------------------------------------------------------------------ # Function to get hosts and paths from arguments # ------------------------------------------------------------------------------