2
0
mirror of https://opendev.org/x/pyghmi synced 2025-02-15 01:59:17 +00:00

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
This commit is contained in:
Jarrod Johnson 2019-10-24 15:17:31 -04:00
parent 284bebb00e
commit 44bf8d79b3

View File

@ -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':