From 19028f0d9da8c010700b7f0bfced3de0423a1682 Mon Sep 17 00:00:00 2001 From: Dan Mick Date: Thu, 10 Oct 2019 15:18:51 -0700 Subject: [PATCH] mgr/telemetry: dict.pop() errs on nonexistent key I suggested this in a review, but failed to correctly understand what happens when the key doesn't exist. Test for it. Signed-off-by: Dan Mick --- src/pybind/mgr/telemetry/module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/telemetry/module.py b/src/pybind/mgr/telemetry/module.py index 6065a52cbb805..e730903ea9fe6 100644 --- a/src/pybind/mgr/telemetry/module.py +++ b/src/pybind/mgr/telemetry/module.py @@ -336,7 +336,8 @@ class Module(MgrModule): # anonymize the smartctl report itself for k in ['serial_number']: - m.pop(k) + if k in m: + m.pop(k) res[anon_devid] = m return res -- 2.47.3