From 6d36e803b166d0801ef69218860a63c56a05a879 Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Thu, 13 Aug 2026 18:07:21 +0200 Subject: [PATCH] Fix reading the identify state and the description over redfish get_identify indexed the sysinfo method object rather than awaiting it, so reading the identify state raised a KeyError naming a bound method on every redfish system. Read the indicator from the chassis that owns the physical led, since some implementations leave the copy on the system stale, and say plainly when a platform does not report one. The generic get_description took no fishclient while every other handler and the caller pass one, so the description resource raised a TypeError on any non Lenovo bmc. --- confluent_server/aiohmi/redfish/command.py | 20 +++++++++++++++++-- .../aiohmi/redfish/oem/generic.py | 4 ++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/confluent_server/aiohmi/redfish/command.py b/confluent_server/aiohmi/redfish/command.py index e3e2fb92..f2d48f00 100644 --- a/confluent_server/aiohmi/redfish/command.py +++ b/confluent_server/aiohmi/redfish/command.py @@ -873,8 +873,24 @@ class Command(object): } async def get_identify(self): - await self.sysinfo() - ledstate = self.sysinfo + sysinfo = await self.sysinfo() + ledstate = sysinfo.get('IndicatorLED', None) + # The physical indicator belongs to the chassis, and some + # implementations do not refresh the system copy of it when it + # changes, so prefer a chassis that describes this system alone. + for chassis in sysinfo.get('Links', {}).get('Chassis', []): + chassisinfo = await self._do_web_request(chassis['@odata.id']) + if len(chassisinfo.get('Links', {}).get('ComputerSystems', [])) > 1: + continue + if chassisinfo.get('IndicatorLED', None) in self._idstatemap: + ledstate = chassisinfo['IndicatorLED'] + break + if ledstate is None: + raise exc.UnsupportedFunctionality( + 'Indicator LED state is not reported by this platform') + if ledstate not in self._idstatemap: + raise exc.PyghmiException( + 'Unrecognized indicator LED state "{0}"'.format(ledstate)) return {'identifystate': self._idstatemap[ledstate]} async def get_health(self, verbose=True): diff --git a/confluent_server/aiohmi/redfish/oem/generic.py b/confluent_server/aiohmi/redfish/oem/generic.py index f5408555..a5a99aad 100644 --- a/confluent_server/aiohmi/redfish/oem/generic.py +++ b/confluent_server/aiohmi/redfish/oem/generic.py @@ -990,8 +990,8 @@ class OEMHandler(object): async def detach_remote_media(self): return None - async def get_description(self): - sysinfo = await self.sysinfo() + async def get_description(self, fishclient): + sysinfo = await fishclient.sysinfo() for chassis in sysinfo.get('Links', {}).get('Chassis', []): chassisurl = chassis['@odata.id'] chassisinfo = await self._do_web_request(chassisurl)