From 5050580bb83b01a840811e2f7b6a850671ef96ed Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Thu, 24 Sep 2026 18:24:55 +0200 Subject: [PATCH] Stop redfish sensor health from raising on a missing Health SensorReading computed health and states with .get() and then overwrote both with a strict lookup, so a sensor whose Status lacks Health, or carries a value outside the health map, raised KeyError and aborted the whole sensor listing. Keep the tolerant lookup, and drop the states of a reading that is OK, as the copy in command.py already does. --- confluent_server/aiohmi/redfish/oem/generic.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/confluent_server/aiohmi/redfish/oem/generic.py b/confluent_server/aiohmi/redfish/oem/generic.py index 0aa296b9..17799ca6 100644 --- a/confluent_server/aiohmi/redfish/oem/generic.py +++ b/confluent_server/aiohmi/redfish/oem/generic.py @@ -111,6 +111,7 @@ def natural_sort(iterable): class SensorReading(object): def __init__(self, healthinfo, sensor=None, value=None, units=None, unavailable=False): + self.states = [] if sensor: self.name = sensor['name'] else: @@ -119,8 +120,8 @@ class SensorReading(object): 'Status', {}).get('Health', None), const.Health.Warning) self.states = [healthinfo.get('Status', {}).get('Health', 'Unknown')] - self.health = _healthmap[healthinfo['Status']['Health']] - self.states = [healthinfo['Status']['Health']] + if self.health == const.Health.Ok: + self.states = [] self.value = value self.state_ids = None self.imprecision = None