]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mgr/prometheus: Handle empty/invalid JSON from orch get-security-config
authorSunnatillo <sunnat.samadov@est.tech>
Thu, 14 Aug 2025 12:55:34 +0000 (15:55 +0300)
committerSunnatillo <sunnat.samadov@est.tech>
Tue, 9 Sep 2025 10:22:34 +0000 (13:22 +0300)
Signed-off-by: Sunnatillo <sunnat.samadov@est.tech>
src/pybind/mgr/prometheus/module.py

index 1b8568dceae3a1761d0b59a9560f9a80596ed9c7..cca90245bbb13734177dab4ba226ac0b0e5129f0 100644 (file)
@@ -1834,6 +1834,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)
@@ -1841,8 +1842,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)