mirror of
https://opendev.org/x/pyghmi
synced 2026-03-28 05:43:30 +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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user