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:
parent
0513a98094
commit
d27bc616b6
@ -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
|
||||
|
||||
|
@ -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"
|
||||
|
@ -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
|
||||
|
||||
|
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user