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:
parent
5cbe262fda
commit
f2b5a80bee
@ -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 -------------
|
||||
|
@ -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
|
||||
|
@ -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 ------------
|
||||
|
@ -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 ------------
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
@ -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
|
||||
|
||||
#-------------------------------------------------------------------------------
|
||||
|
@ -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]
|
||||
|
Loading…
x
Reference in New Issue
Block a user