2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-27 19:37:44 +00:00

Have LED fallback force a sensor if no other explanation

This mitigates the poor appearance of the 'unexplained health'
scenario.

Change-Id: I5b41c51050789773a3851b39137316deee05f74b
This commit is contained in:
Jarrod Johnson 2019-03-28 10:22:14 -04:00
parent 13025ea364
commit 191acd0758

View File

@ -1723,9 +1723,16 @@ class XCCClient(IMMClient):
'type': item['source'],
}, ''))
if summary.get('health', pygconst.Health.Ok) == pygconst.Health.Ok:
# Fault LED is lit without explanation, mark critical
# to encourage examination
summary['health'] = pygconst.Health.Critical
# Fault LED is lit without explanation, mark to encourage
# examination
summary['health'] = pygconst.Health.Warning
if not fallbackdata:
fallbackdata.append(sdr.SensorReading({
'name': 'Fault LED',
'states': ['Active'],
'health': pygconst.Health.Warning,
'type': 'LED',
}, ''))
raise pygexc.FallbackData(fallbackdata)
# Will use the generic handling for unhealthy systems