mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-30 22:50:10 +03:00
feature #3915: deprecate http source in TM scripts
This commit is contained in:
parent
2715e80d9e
commit
a8968e2e6e
@ -104,20 +104,7 @@ EOF
|
||||
)
|
||||
fi
|
||||
|
||||
case $SRC in
|
||||
http://*)
|
||||
log "Downloading $SRC into $DST_PATH"
|
||||
ssh_exec_and_log $DST_HOST \
|
||||
"$WGET -O $DST_PATH $SRC" \
|
||||
"Error downloading $SRC"
|
||||
;;
|
||||
|
||||
*)
|
||||
log "Cloning $SRC_PATH in $DST"
|
||||
|
||||
|
||||
ssh_exec_and_log "$DST_HOST" "$CLONE_CMD" "Error copying $SRC to $DST"
|
||||
;;
|
||||
esac
|
||||
log "Cloning $SRC_PATH in $DST"
|
||||
ssh_exec_and_log "$DST_HOST" "$CLONE_CMD" "Error copying $SRC to $DST"
|
||||
|
||||
exit 0
|
||||
|
@ -88,25 +88,14 @@ if [ -n "$ORIGINAL_SIZE" -a "$SIZE" -gt "$ORIGINAL_SIZE" ]; then
|
||||
RESIZE_CMD="; qemu-img resize ${DST_PATH} ${SIZE}M"
|
||||
fi
|
||||
|
||||
case $SRC in
|
||||
http://*)
|
||||
log "Downloading $SRC into $DST_PATH"
|
||||
ssh_exec_and_log $DST_HOST \
|
||||
"$WGET -O $DST_PATH $SRC" \
|
||||
"Error downloading $SRC"
|
||||
;;
|
||||
log "Cloning $SRC_PATH in $DST"
|
||||
|
||||
*)
|
||||
log "Cloning $SRC_PATH in $DST"
|
||||
CLONE_CMD="cd ${DST_DIR}; \
|
||||
cp ${SRC_PATH} ${DST_PATH} \
|
||||
${RESIZE_CMD}"
|
||||
|
||||
CLONE_CMD="cd ${DST_DIR}; \
|
||||
cp ${SRC_PATH} ${DST_PATH} \
|
||||
${RESIZE_CMD}"
|
||||
|
||||
ssh_exec_and_log $DST_HOST \
|
||||
"$CLONE_CMD" \
|
||||
"Error copying $SRC to $DST"
|
||||
;;
|
||||
esac
|
||||
ssh_exec_and_log $DST_HOST \
|
||||
"$CLONE_CMD" \
|
||||
"Error copying $SRC to $DST"
|
||||
|
||||
exit 0
|
||||
|
@ -77,27 +77,17 @@ ORIGINAL_SIZE="${XPATH_ELEMENTS[j++]}"
|
||||
#-------------------------------------------------------------------------------
|
||||
# Copy files to the remote host
|
||||
#-------------------------------------------------------------------------------
|
||||
case $SRC in
|
||||
http://*)
|
||||
log "Downloading $SRC"
|
||||
RMT_CMD="$WGET -O $DST_PATH $SRC"
|
||||
ssh_exec_and_log "$DST_HOST" "$RMT_CMD" "Error downloading $SRC"
|
||||
;;
|
||||
log "Cloning $SRC in $DST_PATH"
|
||||
exec_and_log "$SCP -r $SRC $DST" "Error copying $SRC to $DST"
|
||||
|
||||
*)
|
||||
log "Cloning $SRC in $DST_PATH"
|
||||
exec_and_log "$SCP -r $SRC $DST" "Error copying $SRC to $DST"
|
||||
if [ -d "${SRC_PATH_SNAP}" ]; then
|
||||
exec_and_log "$SCP -r ${SRC_PATH_SNAP} ${DST_PATH_SNAP}" \
|
||||
"Error copying $SRC to $DST"
|
||||
fi
|
||||
|
||||
if [ -d "${SRC_PATH_SNAP}" ]; then
|
||||
exec_and_log "$SCP -r ${SRC_PATH_SNAP} ${DST_PATH_SNAP}" \
|
||||
"Error copying $SRC to $DST"
|
||||
fi
|
||||
|
||||
if [ -n "$ORIGINAL_SIZE" -a "$SIZE" -gt "$ORIGINAL_SIZE" ]; then
|
||||
RESIZE_CMD="qemu-img resize ${DST_PATH} ${SIZE}M"
|
||||
ssh_exec_and_log "$DST_HOST" "$RESIZE_CMD" \
|
||||
"Error resizing image $DST"
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
if [ -n "$ORIGINAL_SIZE" -a "$SIZE" -gt "$ORIGINAL_SIZE" ]; then
|
||||
RESIZE_CMD="qemu-img resize ${DST_PATH} ${SIZE}M"
|
||||
ssh_exec_and_log "$DST_HOST" "$RESIZE_CMD" \
|
||||
"Error resizing image $DST"
|
||||
fi
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user