From: Venky Shankar Date: Fri, 26 Aug 2022 08:59:19 +0000 (-0400) Subject: pybind/mgr: check for empty metadata mgr_module:get_metadata() X-Git-Tag: v17.2.6~92^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3cfd43d76b1acff12d14d8bd9ca2245ff4d81e7e;p=ceph.git pybind/mgr: check for empty metadata mgr_module:get_metadata() ... rather than just None - looks like we could get back an empty dictionary when the metadata isn't populated (which is asynchronous). Fixes: http://tracker.ceph.com/issues/57072 Signed-off-by: Venky Shankar (cherry picked from commit 42ee5145a2ad9eec0822e1341cc3c5bd9ca2aae8) --- diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index ff15ff69c772..bd6872b688d7 100644 --- a/src/pybind/mgr/mgr_module.py +++ b/src/pybind/mgr/mgr_module.py @@ -1562,7 +1562,7 @@ class MgrModule(ceph_module.BaseMgrModule, MgrModuleLoggingMixin): :rtype: dict, or None if no metadata found """ metadata = self._ceph_get_metadata(svc_type, svc_id) - if metadata is None: + if not metadata: return default return metadata