From 42ee5145a2ad9eec0822e1341cc3c5bd9ca2aae8 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Fri, 26 Aug 2022 04:59:19 -0400 Subject: [PATCH] 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 --- src/pybind/mgr/mgr_module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.47.3