mirror of
https://github.com/OpenNebula/one.git
synced 2026-11-19 03:12:55 +09:00
feature #2097: Minor fixes
This commit is contained in:
1 parent
1f69905000
commit
f86a75beea
3 files changed
+13
-10
No files matched your search
@@ -93,6 +93,11 @@ log "Making raw filesystem of ${SIZE}M at [$DS_ID]$DST_FOLDER on $DST_HOST"
|
||||
|
||||
IMAGE_FORMAT=vmdk
|
||||
VMWARE_DISK_TYPE=`echo $FSTYPE|cut -d'_' -f 2`
|
||||
echo "$VMWARE_DISK_TYPE" | grep '\<thin\>\|\<zeroedthic\>\|\<eagerzeroedthick\>'
|
||||
|
||||
if [ $? -eq 1 ] ; then
|
||||
VMWARE_DISK_TYPE="thin"
|
||||
fi
|
||||
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
$SSH $DST_HOST $VMKFSTOOLS -U [$DS_ID]$DST_FOLDER/disk.vmdk &> /dev/null
|
||||
|
||||
@@ -68,8 +68,8 @@ vmfs_set_up
|
||||
|
||||
log "Removing $SRC from the image repository"
|
||||
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
if [ -n $DS_ID -a -n $DST_FOLDER ]; then
|
||||
if [ "$USE_SSH" == "yes" ]; then
|
||||
if [ -n $DS_ID -a -n $SRC_FOLDER ]; then
|
||||
ssh_exec_and_log $DST_HOST "rm -rf $SRC" "Error deleting $SRC"
|
||||
fi
|
||||
else
|
||||
@@ -77,10 +77,10 @@ else
|
||||
FILES_TO_ERASE=`vifs $VI_PARAMS --dir [$DS_ID]$SRC_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_ID]$SRC_FOLDER/$file" \
|
||||
"Cannot delete $DST_FOLDER/$file in $DST_HOST"
|
||||
"Cannot delete $SRC_FOLDER/$file in $DST_HOST"
|
||||
done
|
||||
exec_and_log "vifs $VI_PARAMS --force --rm [$DS_ID]$DST_FOLDER" \
|
||||
"Cannot delete $DST_FOLDER in $DST_HOST"
|
||||
exec_and_log "vifs $VI_PARAMS --force --rm [$DS_ID]$SRC_FOLDER" \
|
||||
"Cannot delete $SRC_FOLDER in $DST_HOST"
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -282,10 +282,8 @@ function mkfs_command {
|
||||
;;
|
||||
"vmdk_"*)
|
||||
VMWARE_DISK_TYPE=`echo $FSTYPE|cut -d'_' -f 2`
|
||||
echo "WHICH_SUDO=\$(which sudo) ; \
|
||||
[ ! -z \"\$WHICH_SUDO\" -a -f \"\$WHICH_SUDO\" ] && SUDO=\"sudo\" ; \
|
||||
\$SUDO $VMKFSTOOLS -U $DST/disk.vmdk; \
|
||||
\$SUDO $VMKFSTOOLS -c ${SIZE}M -d ${VMWARE_DISK_TYPE} $DST/disk.vmdk"
|
||||
echo "$VMKFSTOOLS -U $DST/disk.vmdk; \
|
||||
$VMKFSTOOLS -c ${SIZE}M -d ${VMWARE_DISK_TYPE} $DST/disk.vmdk"
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
@@ -416,7 +414,7 @@ function is_iscsi {
|
||||
fi
|
||||
}
|
||||
|
||||
# Checks wether $IMAGE_TYPE is CDROM
|
||||
# Checks wether $IMAGE_TYPE is CDROM
|
||||
function is_cdrom {
|
||||
[ "$IMAGE_TYPE" = "1" ]
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user