1
0
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:
Jaime Melis 2015-10-14 16:57:52 +02:00
parent 548b9ce83e
commit 32b6267001
6 changed files with 31 additions and 0 deletions

View File

@ -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

View File

@ -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

View File

@ -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
)

View File

@ -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

View File

@ -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

View File

@ -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
)