2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-14 03:37:47 +00:00

Ensure XCC health sets general level

In the event of an event that is not modeled by the IPMI sensors,
make sure that at least the health summary is correct.  Add in
a known condition that is missed by IPMI sensor modeling for detail
as well.

Change-Id: I207e137c49b4321cf4040188a84de569f55c5707
This commit is contained in:
Jarrod Johnson 2019-01-23 10:24:38 -05:00
parent f4e3f62ef2
commit 6d9a4b98d8

View File

@ -1603,6 +1603,25 @@ class XCCClient(IMMClient):
if 'items' in rsp and len(rsp['items']) == 0:
# The XCC reports healthy, no need to interrogate
raise pygexc.BypassGenericBehavior()
for item in rsp['items']:
# 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
if (item['severity'] == 'W' and
summary['health'] < pygconst.Health.Warning):
summary['health'] = pygconst.Health.Warning
if (item['severity'] == 'E' and
summary['health'] < pygconst.Health.Critical):
summary['health'] = pygconst.Health.Critical
if item['cmnid'] == 'FQXSPPW0104J':
# This event does not get modeled by the sensors
# add a made up sensor to explain
summary['badreadings'].append(
sdr.SensorReading({'name': item['source'],
'states': ['Not Redundant'],
'state_ids': [3],
'health': pygconst.Health.Warning,
'type': 'Power'}, ''))
# Will use the generic handling for unhealthy systems
def get_licenses(self):