From: Sunnatillo Date: Thu, 14 Aug 2025 12:55:34 +0000 (+0300) Subject: mgr/prometheus: Handle empty/invalid JSON from orch get-security-config X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=776063737d6400e543c4ebd736988685b6207382;p=ceph-ci.git mgr/prometheus: Handle empty/invalid JSON from orch get-security-config Signed-off-by: Sunnatillo --- diff --git a/src/pybind/mgr/prometheus/module.py b/src/pybind/mgr/prometheus/module.py index 1b8568dceae..cca90245bbb 100644 --- a/src/pybind/mgr/prometheus/module.py +++ b/src/pybind/mgr/prometheus/module.py @@ -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)