]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/telemetry: check that backtrace is not empty when redacting 44328/head
authorYaarit Hatuka <yaarit@redhat.com>
Thu, 16 Dec 2021 02:53:04 +0000 (02:53 +0000)
committerYaarit Hatuka <yaarit@redhat.com>
Thu, 16 Dec 2021 02:53:04 +0000 (02:53 +0000)
Some python crashes contain empty backtraces; check before redacting
their final line.

Fixes: https://tracker.ceph.com/issues/53604
Signed-off-by: Yaarit Hatuka <yaarit@redhat.com>
src/pybind/mgr/telemetry/module.py

index 1346a7511e9e4395a4242497ecd51ab041f80064..3ff50d650df36d0f8620135f1c0e2686965ecf83 100644 (file)
@@ -483,8 +483,10 @@ class Module(MgrModule):
 
             # redact final line of python tracebacks, as the exception
             # payload may contain identifying information
-            if 'mgr_module' in c:
-                c['backtrace'][-1] = '<redacted>'
+            if 'mgr_module' in c and 'backtrace' in c:
+                # backtrace might be empty
+                if len(c['backtrace']) > 0:
+                    c['backtrace'][-1] = '<redacted>'
 
             crashlist.append(c)
         return crashlist