feature #Â1360Â: Allow empy Ãpasswords

This commit is contained in:
Tino Vazquez committed 2012-09-21 17:19:30 +02:00
1 parent 5cbe262fda
commit f2b5a80bee
11 files changed
+19 -11

No files matched your search

+1 -1
View File
@@ -68,7 +68,7 @@ DST_HOST=`get_destination_host $(dirname $0)`
if [ "$USE_SSH" != "yes" ]; then
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD"
VI_PARAMS="--server $DST_HOST --username $USERNAME --password \"$PASSWORD\""
fi
# ------------ Copy the image to the repository -------------
+1 -1
View File
@@ -79,7 +79,7 @@ DST_HOST=`get_destination_host $(dirname $0)`
if [ "$USE_SSH" != "yes" ]; then
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD"
VI_PARAMS="--server $DST_HOST --username $USERNAME --password \"$PASSWORD\""
fi
# Create DST in DST_HOST
+1 -1
View File
@@ -74,7 +74,7 @@ DST_HOST=`get_destination_host $(dirname $0)`
if [ "$USE_SSH" != "yes" ]; then
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD"
VI_PARAMS="--server $DST_HOST --username $USERNAME --password \"$PASSWORD\""
fi
# ------------ Image to save_as disk, no need to create a FS ------------
+1 -1
View File
@@ -60,7 +60,7 @@ DST_FOLDER=`basename $SRC`
if [ "$USE_SSH" != "yes" ]; then
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD"
VI_PARAMS="--server $DST_HOST --username $USERNAME --password \"$PASSWORD\""
fi
# ------------ Remove the image from the repository ------------
+5 -1
View File
@@ -99,7 +99,11 @@ conf = YAML::load(File.read(CONF_FILE))
@uri = conf[:libvirt_uri].gsub!('@HOST@', host)
@user = conf[:username]
@pass = conf[:password]
if conf[:password] and !conf[:password].empty?
@pass=conf[:password]
else
@pass="\"\""
end
# Poll the VMware hypervisor
+1 -1
View File
@@ -59,7 +59,7 @@ if [ "$USE_SSH" != "yes" ]; then
IMAGE_DS_NAME=`basename $(dirname $SRC_PATH)`
SYSTEM_DS_NAME=`basename $(dirname $(dirname $DST_PATH))`
DST_DIR_WITHOUT_DS_PATH="[$SYSTEM_DS_NAME]${DST_PATH##"$DS_DIR/$SYSTEM_DS_NAME/"}"
VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD"
VI_PARAMS="--server $DST_HOST --username $USERNAME --password \"$PASSWORD\""
fi
if [ "$USE_SSH" == "yes" ]; then
+1 -1
View File
@@ -53,7 +53,7 @@ DST_FOLDER=`basename $DST_PATH`
if [ "$USE_SSH" != "yes" ]; then
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD"
VI_PARAMS="--server $DST_HOST --username $USERNAME --password \"$PASSWORD\""
fi
if [ "$USE_SSH" == "yes" ]; then
+1 -1
View File
@@ -60,7 +60,7 @@ if [ "$USE_SSH" == "yes" ]; then
else
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD"
VI_PARAMS="--server $DST_HOST --username $USERNAME --password \"$PASSWORD\""
DIRS_TO_ERASE=`vifs $VI_PARAMS --dir [$DSID]$VMID|grep -v "Content Listing"|grep -v "\-\-\-\-\-\-\-\-"|egrep -v "^[[:space:]]*$"`
for dir in $DIRS_TO_ERASE; do
+1 -1
View File
@@ -55,7 +55,7 @@ if [ "$USE_SSH" != "yes" ]; then
SYSTEM_DS_NAME=`basename $(dirname $(dirname $DST_PATH))`
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
VI_PARAMS="--server $DST_HOST --username $USERNAME --password $PASSWORD"
VI_PARAMS="--server $DST_HOST --username $USERNAME --password \"$PASSWORD\""
fi
#-------------------------------------------------------------------------------
+1 -1
View File
@@ -61,7 +61,7 @@ if [ "$USE_SSH" != "yes" ]; then
SYSTEM_DS_NAME=`basename $(dirname $(dirname $SRC_PATH))`
USERNAME=`echo $(cat $VMWARERC |grep ":username:"|cut -d":" -f 3|tr -d '"')`
PASSWORD=`echo $(cat $VMWARERC |grep ":password:"|cut -d":" -f 3|tr -d '"')`
VI_PARAMS="--server $SRC_HOST --username $USERNAME --password $PASSWORD"
VI_PARAMS="--server $SRC_HOST --username $USERNAME --password \"$PASSWORD\""
fi
#-------------------------------------------------------------------------------
+5 -1
View File
@@ -50,7 +50,11 @@ class VMwareDriver
@uri = conf[:libvirt_uri].gsub!('@HOST@', host)
@user = conf[:username]
@pass = conf[:password]
if conf[:password] and !conf[:password].empty?
@pass=conf[:password]
else
@pass="\"\""
end
@datacenter = conf[:datacenter]
@vcenter = conf[:vcenter]