From 64a40abcc3b98f362ee350b866ab427c259601e7 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 9 May 2022 08:56:15 -0400 Subject: [PATCH] Handle XCC not sending thermal data in some situations Treat missing items member as no data to properly move on from this condition Change-Id: I14623e513ec91411978019b088e0f9e36889796b --- pyghmi/ipmi/oem/lenovo/imm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index ec35241f..3209cd6c 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -1456,7 +1456,7 @@ class XCCClient(IMMClient): therminfo = self.grab_cacheable_json( '/api/dataset/pwrmgmt?params=GetThermalRealTimeData', 1) if therminfo: - for name in sorted(therminfo['items'][0]): + for name in sorted(therminfo.get('items', [[]])[0]): if 'DIMM' in name and 'Temp' in name: oemsensornames = oemsensornames + (name,) return oemsensornames