From c5a7f94114b2731c8de0fc847134b0bdb726aeed Mon Sep 17 00:00:00 2001 From: Ilya Dryomov Date: Tue, 27 Jul 2021 18:45:20 +0200 Subject: [PATCH] pybind/rbd: explain why "primary" isn't exposed in mirror_image_status_list() "primary" is part of mirror image info (rbd_mirror_image_info_t) and is exposed in mirror_image_get_status(). mirror_image_status_list(), even though it is often thought of as an equivalent of repeated calls to mirror_image_get_status(), doesn't actually fetch the mirror image info. Signed-off-by: Ilya Dryomov (cherry picked from commit 1d2a142108b2aa102103e62ccdf3bd17688b783b) --- src/pybind/rbd/rbd.pyx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/pybind/rbd/rbd.pyx b/src/pybind/rbd/rbd.pyx index fa9197a5f99c6..16014f1409cfb 100644 --- a/src/pybind/rbd/rbd.pyx +++ b/src/pybind/rbd/rbd.pyx @@ -2278,6 +2278,8 @@ cdef class MirrorImageStatusIterator(object): 'info' : { 'global_id' : decode_cstr(self.images[i].info.global_id), 'state' : self.images[i].info.state, + # primary isn't added here because it is unknown (always + # false, see XXX in Mirror::image_global_status_list()) }, 'remote_statuses': site_statuses, } -- 2.39.5