From: Sage Weil Date: Thu, 14 Nov 2019 16:28:47 +0000 (-0600) Subject: mgr/crash: behave when posted crash has no backtrace X-Git-Tag: v15.1.0~892^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f5b197df930550192fd09a11d780b4ff0ebbf815;p=ceph.git mgr/crash: behave when posted crash has no backtrace This is the case when the qa/tasks/mgr/test_crash.py test runs, and could happen in the real world too, perhaps, if someone fed us wonky input. Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/crash/module.py b/src/pybind/mgr/crash/module.py index 4cbe1641d465..34128b93c238 100644 --- a/src/pybind/mgr/crash/module.py +++ b/src/pybind/mgr/crash/module.py @@ -181,7 +181,8 @@ class Module(MgrModule): metadata = self.validate_crash_metadata(inbuf) except Exception as e: return errno.EINVAL, '', 'malformed crash metadata: %s' % e - metadata['stack_sig'] = self.calc_sig( + if 'backtrace' in metadata: + metadata['stack_sig'] = self.calc_sig( metadata.get('backtrace'), metadata.get('assert_msg')) crashid = metadata['crash_id']