From 2139ef7a4814251088f3142d18b637ca5f22ac05 Mon Sep 17 00:00:00 2001 From: Wido den Hollander Date: Wed, 2 Oct 2019 09:37:49 +0200 Subject: [PATCH] mgr/telemetry: Ignore crashes in report when module not enabled The crash module is not guaranteerd to be enabled and this will render the telemetry module useless: Error EINVAL: Traceback (most recent call last): File "/usr/lib/ceph/mgr/telemetry/module.py", line 325, in handle_command report = self.compile_report() File "/usr/lib/ceph/mgr/telemetry/module.py", line 291, in compile_report report['crashes'] = self.gather_crashinfo() File "/usr/lib/ceph/mgr/telemetry/module.py", line 214, in gather_crashinfo errno, crashids, err = self.remote('crash', 'do_ls', '', '') File "/usr/lib/ceph/mgr/mgr_module.py", line 845, in remote args, kwargs) ImportError: Module not found We can safely ignore this error and just continue without the crash information. Fixes: https://tracker.ceph.com/issues/42116 Signed-off-by: Wido den Hollander --- src/pybind/mgr/telemetry/module.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py index ff64b8276d2f..df0accf57881 100644 --- a/src/pybind/mgr/telemetry/module.py +++ b/src/pybind/mgr/telemetry/module.py @@ -288,7 +288,10 @@ class Module(MgrModule): for key, value in service_map['services'].items(): report['services'][key] += 1 - report['crashes'] = self.gather_crashinfo() + try: + report['crashes'] = self.gather_crashinfo() + except ImportError: + self.log.debug('Not adding crashes as the crash module is not enabled') return report -- 2.47.3