From 57f6c18ebd3aa3f57c6e838866edc00a35c5a98b Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 21 Sep 2026 10:16:48 -0400 Subject: [PATCH] Fix early handling in Lenovo OEM handling If mgrinfo is needed, have logic local, to avoid the mess during early initialization. --- confluent_server/aiohmi/redfish/oem/lenovo/main.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/confluent_server/aiohmi/redfish/oem/lenovo/main.py b/confluent_server/aiohmi/redfish/oem/lenovo/main.py index de04ae1b..fd2de0e0 100644 --- a/confluent_server/aiohmi/redfish/oem/lenovo/main.py +++ b/confluent_server/aiohmi/redfish/oem/lenovo/main.py @@ -37,8 +37,16 @@ async def get_handler(sysinfo, sysurl, webclient, cache, cmd, rootinfo={}): if status != 200: mgrinfo = {} if not leninf: - bmcinfo = await cmd.bmcinfo() - if 'Ami' in bmcinfo.get('Oem', {}): + mgrcollection, status = await webclient.grab_json_response_with_status('/redfish/v1/Managers') + if status != 200: + mgrcollection = {} + managers = mgrcollection.get('Members', []) + if len(managers) != 1: + raise exc.PyghmiException('Unexpected number of managers found') + mgrinfo, status = await webclient.grab_json_response_with_status(managers[0].get('@odata.id', '')) + if status != 200: + mgrinfo = {} + if 'Ami' in mgrinfo.get('Oem', {}): return await tsma.TsmHandler.create(sysinfo, sysurl, webclient, cache, gpool=cmd._gpool) elif 'xclarity controller' in mgrinfo.get('Model', '').lower(): if mgrinfo['Model'].endswith('3'):