mirror of
https://github.com/OpenNebula/one.git
synced 2024-12-27 03:21:29 +03:00
feature #3362: Return error if RBD target not found
This commit is contained in:
parent
548b9ce83e
commit
32b6267001
@ -79,6 +79,11 @@ SNAP_DELETE_CMD=$(cat <<EOF
|
||||
|
||||
RBD_TGT=\$(rbd_find_snap $RBD_SRC $SNAP_ID)
|
||||
|
||||
if [ -z "\$RBD_TGT" ]; then
|
||||
echo "Target RBD not found." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$RBD snap unprotect \${RBD_TGT}@$SNAP_ID
|
||||
$RBD snap rm \${RBD_TGT}@$SNAP_ID
|
||||
|
||||
|
@ -79,6 +79,11 @@ SNAP_FLATTEN_CMD=$(cat <<EOF
|
||||
|
||||
RBD_TGT=\$(rbd_find_snap $RBD_SRC $SNAP_ID)
|
||||
|
||||
if [ -z "\$RBD_TGT" ]; then
|
||||
echo "Target RBD not found." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$RBD clone \${RBD_TGT}@$SNAP_ID $RBD_SRC.flatten
|
||||
|
||||
$RBD flatten $RBD_SRC.flatten
|
||||
|
@ -81,6 +81,11 @@ SNAP_REVERT_CMD=$(cat <<EOF
|
||||
|
||||
RBD_TGT=\$(rbd_find_snap $RBD_SRC $SNAP_ID)
|
||||
|
||||
if [ -z "\$RBD_TGT" ]; then
|
||||
echo "Target RBD not found." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$RBD clone \${RBD_TGT}@$SNAP_ID $RBD_SRC
|
||||
EOF
|
||||
)
|
||||
|
@ -96,6 +96,12 @@ COPY_CMD=$(cat <<EOF
|
||||
rbd_check_2 $RBD_DST
|
||||
|
||||
RBD_DST=\$(rbd_find_snap $RBD_DST $SNAP_ID)
|
||||
|
||||
if [ -z "\$RBD_DST" ]; then
|
||||
echo "Target RBD not found." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
RBD_DST=\$RBD_DST@$SNAP_ID
|
||||
fi
|
||||
|
||||
|
@ -92,6 +92,11 @@ SNAP_DELETE_CMD=$(cat <<EOF
|
||||
|
||||
RBD_TGT=\$(rbd_find_snap $RBD_DST $SNAP_ID)
|
||||
|
||||
if [ -z "\$RBD_TGT" ]; then
|
||||
echo "Target RBD not found." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$RBD snap unprotect \${RBD_TGT}@$SNAP_ID
|
||||
$RBD snap rm \${RBD_TGT}@$SNAP_ID
|
||||
|
||||
|
@ -111,6 +111,11 @@ SNAP_REVERT_CMD=$(cat <<EOF
|
||||
|
||||
RBD_TGT=\$(rbd_find_snap $RBD_DST $SNAP_ID)
|
||||
|
||||
if [ -z "\$RBD_TGT" ]; then
|
||||
echo "Target RBD not found." >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$RBD clone \${RBD_TGT}@$SNAP_ID $RBD_DST
|
||||
EOF
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user