]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/prometheus: fix enabled_modules check for smb metadata 64610/head
authorAvan Thakkar <athakkar@redhat.com>
Mon, 18 Aug 2025 09:12:12 +0000 (14:42 +0530)
committerAvan Thakkar <athakkar@redhat.com>
Mon, 15 Sep 2025 06:37:13 +0000 (12:07 +0530)
For get_smb_metadata check for enabled modules from mgr_map instead of available modules
to get list of mgr modules which are enabled on active mgr.

Signed-off-by: Avan Thakkar <athakkar@redhat.com>
(cherry picked from commit ea255486133c1057194db1ea56b117e498f4a34b)

src/pybind/mgr/prometheus/module.py

index a6df918078b1682f523c09eec1e4c3e2d8e291d1..41b62fd6a93ad8101abb4cd1dd05eb289d4db515 100644 (file)
@@ -1762,9 +1762,9 @@ class Module(MgrModule, OrchestratorClientMixin):
     def get_smb_metadata(self) -> None:
         try:
             mgr_map = self.get('mgr_map')
-            available_modules = [m['name'] for m in mgr_map['available_modules']]
-            if 'smb' not in available_modules:
-                self.log.debug("SMB module is not available, skipping SMB metadata collection")
+            enabled_modules = mgr_map['modules']
+            if 'smb' not in enabled_modules:
+                self.log.debug("SMB module is not enabled, skipping SMB metadata collection")
                 return
 
             if not self.available()[0]: