1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

feature #1360: Allow empy passwords

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

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 -------------

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

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 ------------

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 ------------

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

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

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

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

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
#-------------------------------------------------------------------------------

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
#-------------------------------------------------------------------------------

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]