From d2ead735a59e4e179388f0684ca8b7b41ef6bdfa Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Thu, 13 Aug 2026 18:10:19 +0200 Subject: [PATCH] Consult the manager document when picking a redfish oem handler The lookup fell back to the generic handler whenever it was given the service root, which is the early call during connection setup, so a bmc that names its vendor only in the manager document was served by two different handlers on one connection. Read the manager during that early call too. --- confluent_server/aiohmi/redfish/oem/lookup.py | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/confluent_server/aiohmi/redfish/oem/lookup.py b/confluent_server/aiohmi/redfish/oem/lookup.py index 4f528f8d..a56a9508 100644 --- a/confluent_server/aiohmi/redfish/oem/lookup.py +++ b/confluent_server/aiohmi/redfish/oem/lookup.py @@ -39,9 +39,25 @@ async def get_oem_handler(sysinfo, sysurl, webclient, cache, cmd, rootinfo={}): if oem in OEMMAP: return await OEMMAP[oem].get_handler(sysinfo, sysurl, webclient, cache, cmd, rootinfo) - if rootinfo: # rootinfo indicates early invocation, bmcinfo not ready yet - return await generic.OEMHandler.create(sysinfo, sysurl, webclient, cache, cmd._gpool, rootinfo) - bmcinfo = await cmd.bmcinfo() + # The manager document names the vendor on implementations that do not say + # so at the service root or on the system, so consult it before settling for + # generic. During the early invocation the client cannot fetch it through + # cmd yet, so ask for it directly. + bmcinfo = {} + if rootinfo: + managers = rootinfo.get('Managers', {}).get('@odata.id', None) + if managers: + mgrcol, status = await webclient.grab_json_response_with_status( + managers) + if status == 200: + for manager in mgrcol.get('Members', []): + mgrinfo, status = await webclient.grab_json_response_with_status( + manager['@odata.id']) + if status == 200: + bmcinfo = mgrinfo + break + else: + bmcinfo = await cmd.bmcinfo() for oem in bmcinfo.get('Oem', {}): if oem in OEMMAP: return await OEMMAP[oem].get_handler(sysinfo, sysurl, webclient, cache,