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: v17.1.0~2831^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=8372d9370b530f953acd5bd6502c46fd11f43109;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 --- diff --git a/src/pybind/mgr/rbd_support/mirror_snapshot_schedule.py b/src/pybind/mgr/rbd_support/mirror_snapshot_schedule.py index 88222a420dd..fa8bb019410 100644 --- a/src/pybind/mgr/rbd_support/mirror_snapshot_schedule.py +++ b/src/pybind/mgr/rbd_support/mirror_snapshot_schedule.py @@ -261,6 +261,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)