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: v18.1.0~1105^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=42ee5145a2ad9eec0822e1341cc3c5bd9ca2aae8;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 --- diff --git a/src/pybind/mgr/mgr_module.py b/src/pybind/mgr/mgr_module.py index a45282283217..4fc871416b97 100644 --- a/src/pybind/mgr/mgr_module.py +++ b/src/pybind/mgr/mgr_module.py @@ -1564,7 +1564,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