]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
pybind/mgr: check for empty metadata mgr_module:get_metadata() 49966/head
authorVenky Shankar <vshankar@redhat.com>
Fri, 26 Aug 2022 08:59:19 +0000 (04:59 -0400)
committerVenky Shankar <vshankar@redhat.com>
Thu, 2 Feb 2023 05:45:17 +0000 (11:15 +0530)
... 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 <vshankar@redhat.com>
(cherry picked from commit 42ee5145a2ad9eec0822e1341cc3c5bd9ca2aae8)

src/pybind/mgr/mgr_module.py

index d1b6e7dc96e77a255a9bdad55aaf40ed88d9eeef..c827c4feeb68c59cdafd48847cb8cbaeb2bff15b 100644 (file)
@@ -1303,7 +1303,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