From 44bf8d79b3f13ffb10c96a1f2b84937802da12b2 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 24 Oct 2019 15:17:31 -0400 Subject: [PATCH] Fix mistake in the health fallback If an event with unknown severity occurs, do not place a string in the enum value. Change-Id: I86e96b5b329ca3608dfec67a4043c52fde1a7175 --- pyghmi/ipmi/oem/lenovo/imm.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index 6d84c74c..8adc6722 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -1833,6 +1833,7 @@ class XCCClient(IMMClient): raise pygexc.BypassGenericBehavior() fallbackdata = [] hmap = { + 'I': pygconst.Health.Ok, 'E': pygconst.Health.Critical, 'W': pygconst.Health.Warning, } @@ -1840,7 +1841,7 @@ class XCCClient(IMMClient): # while usually the ipmi interrogation shall explain things, # just in case there is a gap, make sure at least the # health field is accurately updated - itemseverity = hmap.get(item.get('severity', 'E'), 'E') + itemseverity = hmap.get(item.get('severity', 'E'), pygconst.Health.Critical) if (summary['health'] < itemseverity): summary['health'] = itemseverity if item['cmnid'] == 'FQXSPPW0104J':