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

feature #575: added error messages to image mad scripts

This commit is contained in:
Javi Fontan 2011-04-27 16:53:30 +02:00
parent 0513a98094
commit d27bc616b6
4 changed files with 14 additions and 7 deletions

View File

@ -39,12 +39,14 @@ DST=$2
case $SRC in
http://*)
log "Downloading $SRC to the image repository"
exec_and_log "$WGET -O $DST $SRC"
exec_and_log "$WGET -O $DST $SRC" \
"Error downloading $SRC"
;;
*)
log "Copying local image $SRC to the image repository"
exec_and_log "cp -f $SRC $DST"
exec_and_log "cp -f $SRC $DST" \
"Error copying $SRC to $DST"
;;
esac

View File

@ -37,6 +37,8 @@ DST=$1
FSTYPE=$2
SIZE=$3
exec_and_log "$DD if=/dev/zero of=$DST bs=1 count=1 seek=${SIZE}M"
exec_and_log "$MKFS -t $FSTYPE -F $DST"
exec_and_log "$DD if=/dev/zero of=$DST bs=1 count=1 seek=${SIZE}M" \
"Could not create image $DST"
exec_and_log "$MKFS -t $FSTYPE -F $DST" \
"Unable to create filesystem $FSTYPE in $DST"
exec_and_log "chmod 0660 $DST"

View File

@ -39,12 +39,14 @@ DST=$2
case $SRC in
http://*)
log "Downloading $SRC to the image repository"
exec_and_log "$WGET -O $DST $SRC"
exec_and_log "$WGET -O $DST $SRC" \
"Error downloading $SRC"
;;
*)
log "Moving local image $SRC to the image repository"
exec_and_log "mv -f $SRC $DST"
exec_and_log "mv -f $SRC $DST" \
"Could not move $SRC to $DST"
;;
esac

View File

@ -36,5 +36,6 @@ SRC=$1
if [ -e $SRC ] ; then
log "Removing $SRC from the image repository"
exec_and_log "rm $SRC"
exec_and_log "rm $SRC" \
"Error deleting $SRC"
fi