2
0
mirror of https://github.com/xcat2/confluent.git synced 2026-09-22 09:32:28 +00:00

Fix early handling in Lenovo OEM handling

If mgrinfo is needed, have logic local, to avoid
the mess during early initialization.
This commit is contained in:
Jarrod Johnson
2026-09-21 10:16:48 -04:00
parent ab5e47e6af
commit 57f6c18ebd
@@ -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'):