From 191acd0758e4f8cc564185c55bc8a149cfbff408 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 28 Mar 2019 10:22:14 -0400 Subject: [PATCH] Have LED fallback force a sensor if no other explanation This mitigates the poor appearance of the 'unexplained health' scenario. Change-Id: I5b41c51050789773a3851b39137316deee05f74b --- pyghmi/ipmi/oem/lenovo/imm.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index 7e893ffb..1a23c6e2 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -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