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

feature #1437: Get rid of trailing whitespaces

This commit is contained in:
Tino Vazquez 2012-09-13 13:47:06 +02:00
parent 95596bb25f
commit ad787ea971
9 changed files with 25 additions and 22 deletions

View File

@ -86,7 +86,7 @@ fi
if [ "$SSH" == "yes" ]; then
ssh_make_path $DST_HOST $DST
else
exec_and_log "vifs $VI_PARAMS --mkdir [$DS_ID]$DST_FOLDER" \
exec_and_log "vifs $VI_PARAMS --mkdir [$DS_ID]$DST_FOLDER" \
"Cannot create $DST in $DST_HOST"
fi
@ -136,7 +136,7 @@ esac
if [ ! -f $SRC/disk.vmdk ]; then
BASE_DISK_FILE=`ls $SRC | grep -v '\-\(flat\|delta\|s[0-9]*\)\.vmdk$'`
exec_and_log "mv -f $SRC/$BASE_DISK_FILE $SRC/disk.vmdk" \
exec_and_log "mv -f $SRC/$BASE_DISK_FILE $SRC/disk.vmdk" \
"Error renaming disk file $SRC/$BASE_DISK_FILE to $SRC/disk.vmdk"
fi
@ -147,7 +147,7 @@ else
cd $SRC
for file in $(find . -type f); do
FNAME=$(basename $file)
exec_and_log "vifs $VI_PARAMS -p $file [$DS_ID]$DST_FOLDER/$FNAME" \
exec_and_log "vifs $VI_PARAMS -p $file [$DS_ID]$DST_FOLDER/$FNAME" \
"Cannot upload $file to $DST/$FNAME on $DST_HOST"
done
fi

View File

@ -86,19 +86,20 @@ fi
# ------------ Create the image within the image datastore ------------
log "Making filesystem of ${SIZE}M (with no format) at $DST"
log "Making filesystem of ${SIZE}M (with no format) at [$IMAGE_DS_ID]$DST_FOLDER on $DST_HOST"
IMAGE_FORMAT=vmdk
VMWARE_DISK_TYPE=`echo $FSTYPE|cut -d'_' -f 2`
if [ "$SSH" == "yes" ]; then
ssh_exec_and_log $DST_HOST "mkdir -p $DST" "Could not create disk directory $DST"
ssh_exec_and_log $DST_HOST "$VMKFSTOOLS -U $DST/disk.vmdk"
ssh_exec_and_log $DST_HOST "$VMKFSTOOLS -c ${SIZE}M -d ${VMWARE_DISK_TYPE} $DST/disk.vmdk" \
"Cannot create $DST/disk.vmdk on $DST_HOST"
ssh_exec_and_log $DST_HOST "mkdir -p /vmfs/volumes/$IMAGE_DS_ID/$DST_FOLDER" \
"Could not create disk directory /vmfs/volumes/$IMAGE_DS_ID/$DST_FOLDER on $DST_HOST"
ssh_exec_and_log $DST_HOST "$VMKFSTOOLS -U [$IMAGE_DS_ID]$DST_FOLDER/disk.vmdk"
ssh_exec_and_log $DST_HOST "$VMKFSTOOLS -c ${SIZE}M -d ${VMWARE_DISK_TYPE} [$IMAGE_DS_ID]$DST_FOLDER/disk.vmdk" \
"Cannot create [$IMAGE_DS_ID] $DST_FOLDER/disk.vmdk on $DST_HOST"
else
exec_and_log "$VMKFSTOOLS $VI_PARAMS -U $DST_PATH/disk.vmdk"
exec_and_log "vifs $VI_PARAMS --mkdir [$IMAGE_DS_ID]$DST_FOLDER" \
exec_and_log "$VMKFSTOOLS $VI_PARAMS -U [$IMAGE_DS_ID]$DST_FOLDER/disk.vmdk"
exec_and_log "vifs $VI_PARAMS --mkdir [$IMAGE_DS_ID]$DST_FOLDER" \
"Cannot create [$IMAGE_DS_ID] $DST_FOLDER on $DST_HOST"
exec_and_log "$VMKFSTOOLS $VI_PARAMS -c ${SIZE}M -d ${VMWARE_DISK_TYPE} [$IMAGE_DS_ID]$DST_FOLDER/disk.vmdk" \
"Cannot create $IMAGE_DS_ID]$DST_FOLDER/disk.vmdk on $DST_HOST"

View File

@ -69,17 +69,17 @@ log "Removing $SRC from the image repository"
if [ "$SSH" == "yes" ]; then
if [ -n $DS_NAME -a -n $DST_FOLDER ]; then
ssh_exec_and_log $DST_HOST "rm -rf /vmfs/volumes/$DS_NAME/$DST_FOLDER" \
ssh_exec_and_log $DST_HOST "rm -rf /vmfs/volumes/$DS_NAME/$DST_FOLDER" \
"Error deleting $SRC"
fi
else
# We have to erase the contents of the folder one by one
FILES_TO_ERASE=`vifs $VI_PARAMS --dir [$DS_NAME]$FOLDER_TO_ERASE|grep -v "Content Listing"|grep -v "\-\-\-\-\-\-\-\-"|egrep -v "^[[:space:]]*$"`
FILES_TO_ERASE=`vifs $VI_PARAMS --dir [$DS_NAME]$DST_FOLDER|grep -v "Content Listing"|grep -v "\-\-\-\-\-\-\-\-"|egrep -v "^[[:space:]]*$"`
for file in $FILES_TO_ERASE; do
exec_and_log "vifs $VI_PARAMS --force --rm [$DS_NAME]$DST_FOLDER/$file"\
exec_and_log "vifs $VI_PARAMS --force --rm [$DS_NAME]$DST_FOLDER/$file" \
"Cannot delete $DST_FOLDER/$file in $DST_HOST"
done
exec_and_log "vifs $VI_PARAMS --force --rm [$DS_NAME]$DST_FOLDER" \
exec_and_log "vifs $VI_PARAMS --force --rm [$DS_NAME]$DST_FOLDER" \
"Cannot delete $DST_FOLDER in $DST_HOST"
fi

View File

@ -67,7 +67,7 @@ if [ "$SSH" == "yes" ]; then
else
# Two calls needed since vifs cannot do a mkdir -p
vifs $VI_PARAMS --mkdir [$SYSTEM_DS_NAME]$VMID
exec_and_log "vifs $VI_PARAMS --mkdir [$SYSTEM_DS_NAME]$VMID/$DST_FOLDER" \
exec_and_log "vifs $VI_PARAMS --mkdir [$SYSTEM_DS_NAME]$VMID/$DST_FOLDER" \
"Cannot create [$SYSTEM_DS_NAME]$VMID/$DST_FOLDER in $DST_HOST"
fi
@ -93,7 +93,8 @@ EOF
)
ssh_exec_and_log $DST_HOST "$CLONESCRIPT" "Error cloning $SRC to $DST"
else
exec_and_log "$VMKFSTOOLS $VI_PARAMS -i \"$SRC_DIR_WITHOUT_DS_PATH/disk.vmdk\" -d thin \"$DST_DIR_WITHOUT_DS_PATH/disk.vmdk\"" "Error cloning $SRC to $DST"
exec_and_log "$VMKFSTOOLS $VI_PARAMS -i \"$SRC_DIR_WITHOUT_DS_PATH/disk.vmdk\" -d thin \"$DST_DIR_WITHOUT_DS_PATH/disk.vmdk\"" \
"Error cloning $SRC to $DST"
fi
exit 0

View File

@ -61,7 +61,7 @@ if [ "$SSH" == "yes" ]; then
else
vifs $VI_PARAMS --mkdir [$DS_ID]$VM_ID
exec_and_log "vifs $VI_PARAMS --mkdir [$DS_ID]$VM_ID/$DST_FOLDER" \
"Cannot create [$DS_ID]$VM_ID/$DST_FOLDER on %DST_HOST"
"Cannot create [$DS_ID]$VM_ID/$DST_FOLDER on $DST_HOST"
fi
#-------------------------------------------------------------------------------
@ -91,7 +91,8 @@ if [ "$SSH" == "yes" ]; then
exec_and_log "$SCP $ISO_FILE $DST" "Error copying context ISO to $DST"
else
# Copies the iso file with .iso suffix, needed for VMware CDROMs
exec_and_log "vifs $VI_PARAMS -p $ISO_FILE $DST_PATH.iso" "Error copying context ISO to $DST"
exec_and_log "vifs $VI_PARAMS -p $ISO_FILE $DST_PATH.iso" \
"Error copying context ISO to $DST"
fi
rm -rf $ISO_DIR > /dev/null 2>&1

View File

@ -57,7 +57,7 @@ if [ "$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 '"')`
exec_and_log "$VMKFSTOOLS --server $DST_HOST --username $USERNAME --password $PASSWORD -U $DST_PATH" \
exec_and_log "$VMKFSTOOLS --server $DST_HOST --username $USERNAME --password $PASSWORD -U $DST_PATH" \
"Cannot delelete $DST"
fi

View File

@ -70,7 +70,7 @@ for file in \$(cd $DST_DIR ; find $SRC_PATH -type f); do
done
EOF
)
ssh_exec_and_log $DST_HOST "$LINK_SCRIPT" \
ssh_exec_and_log $DST_HOST "$LINK_SCRIPT" \
"Could not link dir files from source DS to system DS"
else
log "Cannot link files without SSH enabled on the ESX hosts"

View File

@ -82,7 +82,7 @@ else
VMWARE_DISK_TYPE=`echo $FSTYPE|cut -d'_' -f 2`
exec_and_log "$VMKFSTOOLS $VI_PARAMS -U $DST_PATH/disk.vmdk"
exec_and_log "$VMKFSTOOLS $VI_PARAMS -c ${SIZE}M -d ${VMWARE_DISK_TYPE} $DST/disk.vmdk" \
exec_and_log "$VMKFSTOOLS $VI_PARAMS -c ${SIZE}M -d ${VMWARE_DISK_TYPE} $DST/disk.vmdk" \
"Cannot create $DST/disk.vmdk on $DST_HOST"
fi

View File

@ -92,7 +92,7 @@ EOF
ssh_exec_and_log $SRC_HOST "$MVSCRIPT" "Could not move image $DST_PATH"
else
exec_and_log "$VMKFSTOOLS $VI_PARAMS -i $SRC_PATH -d thin $DST_PATH" \
exec_and_log "$VMKFSTOOLS $VI_PARAMS -i $SRC_PATH -d thin $DST_PATH" \
"Could not move image $DST_PATH"
fi