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

Bug #4768: attach_disk in qcow2 fails

This commit is contained in:
Jaime Melis 2016-09-08 11:38:46 +02:00
parent 388c183562
commit f8520b7a36
2 changed files with 2 additions and 2 deletions

View File

@ -141,7 +141,7 @@ fi
REGISTER_CMD=$(cat <<EOF
set -e -o pipefail
FORMAT=\$($QEMU_IMG info $TMP_DST | grep "^file format:" | awk '{print \$3}')
FORMAT=\$($QEMU_IMG info $TMP_DST | grep "^file format:" | awk '{print \$3}' || :)
if [ "\$FORMAT" != "raw" ]; then
$QEMU_IMG convert -O raw $TMP_DST $TMP_DST.raw

View File

@ -102,7 +102,7 @@ if [ ! -L "${SNAP_DIR}/${SNAP_NAME}" ]; then
ln -s "${SNAP_DIR}" "${SNAP_DIR}/${SNAP_NAME}"
fi
SNAP="\$(ls ${SNAP_DIR} | grep '^[[:digit:]]*$' | sort -n | tail -n 1)"
SNAP="\$(ls ${SNAP_DIR} | grep '^[[:digit:]]*$' | sort -n | tail -n 1 || :)"
if [ -z "\${SNAP}" ]; then
SNAP=0