From: Kefu Chai Date: Wed, 10 Feb 2021 08:30:49 +0000 (+0800) Subject: mgr/rbd_support: bail out when snapshot mirroring is not enabled X-Git-Tag: v16.2.0~128^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F39741%2Fhead;p=ceph.git mgr/rbd_support: bail out when snapshot mirroring is not enabled before this change, we continue on and try to get mirror info of specified image after calling close_image(), even the snapshot mirroring is not enabled. after this change, we bail out after calling close_image(). this behavior is consistent with other places where we handle errors. Fixes: https://tracker.ceph.com/issues/49355 Signed-off-by: Kefu Chai (cherry picked from commit 8372d9370b530f953acd5bd6502c46fd11f43109) --- diff --git a/src/pybind/mgr/rbd_support/mirror_snapshot_schedule.py b/src/pybind/mgr/rbd_support/mirror_snapshot_schedule.py index 9751d44e4a3d..e5a14e467877 100644 --- a/src/pybind/mgr/rbd_support/mirror_snapshot_schedule.py +++ b/src/pybind/mgr/rbd_support/mirror_snapshot_schedule.py @@ -263,6 +263,7 @@ class CreateSnapshotRequests: pool_id, namespace, image_id, "snapshot mirroring is not enabled")) self.close_image(image_spec, image) + return self.get_mirror_info(image_spec, image)