]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/prometheus: Handle empty/invalid JSON from orch get-security-config 65906/head
authorSunnatillo <sunnat.samadov@est.tech>
Thu, 14 Aug 2025 12:55:34 +0000 (15:55 +0300)
committerSunnatillo <sunnat.samadov@est.tech>
Mon, 13 Oct 2025 06:31:54 +0000 (09:31 +0300)
Signed-off-by: Sunnatillo <sunnat.samadov@est.tech>
src/pybind/mgr/prometheus/module.py

index 41b62fd6a93ad8101abb4cd1dd05eb289d4db515..b49caa0e0d0dff5e386df4e2b6c4c522f6fab2cf 100644 (file)
@@ -1884,6 +1884,7 @@ class Module(MgrModule, OrchestratorClientMixin):
     def configure(self, server_addr: str, server_port: int) -> None:
         cmd = {'prefix': 'orch get-security-config'}
         ret, out, _ = self.mon_command(cmd)
+
         if ret == 0 and out is not None:
             try:
                 security_config = json.loads(out)
@@ -1891,8 +1892,11 @@ class Module(MgrModule, OrchestratorClientMixin):
                     self.setup_tls_config(server_addr, server_port)
                     return
             except Exception as e:
-                self.log.exception(f'Failed to setup cephadm based secure monitoring stack: {e}\n',
-                                   'Falling back to default configuration')
+                self.log.exception(
+                    'Failed to setup cephadm based secure monitoring stack: %s\n'
+                    'Falling back to default configuration',
+                    e
+                )
 
         # In any error fallback to plain http mode
         self.setup_default_config(server_addr, server_port)