diff --git a/confluent_server/aiohmi/redfish/oem/lenovo/main.py b/confluent_server/aiohmi/redfish/oem/lenovo/main.py index 35ba6bbf..de04ae1b 100644 --- a/confluent_server/aiohmi/redfish/oem/lenovo/main.py +++ b/confluent_server/aiohmi/redfish/oem/lenovo/main.py @@ -39,7 +39,7 @@ async def get_handler(sysinfo, sysurl, webclient, cache, cmd, rootinfo={}): if not leninf: bmcinfo = await cmd.bmcinfo() if 'Ami' in bmcinfo.get('Oem', {}): - return tsma.TsmHandler(sysinfo, sysurl, webclient, cache) + 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'): return await xcc3.OEMHandler.create(sysinfo, sysurl, webclient, cache, @@ -60,9 +60,9 @@ async def get_handler(sysinfo, sysurl, webclient, cache, cmd, rootinfo={}): devdesc = await webclient.grab_json_response_with_status('/DeviceDescription.json') if devdesc[1] == 200: if devdesc[0]['type'].lower() in ('lenovo-smm3', 'smm3'): - return smm3.OEMHandler(sysinfo, sysurl, webclient, cache, - gpool=cmd._gpool) + return await smm3.OEMHandler.create(sysinfo, sysurl, webclient, cache, + gpool=cmd._gpool) except Exception: pass - return generic.OEMHandler(sysinfo, sysurl, webclient, cache, - gpool=cmd._gpool) + return await generic.OEMHandler.create(sysinfo, sysurl, webclient, cache, + gpool=cmd._gpool) diff --git a/confluent_server/aiohmi/redfish/oem/lenovo/tsma.py b/confluent_server/aiohmi/redfish/oem/lenovo/tsma.py index afa4851f..d36d9355 100644 --- a/confluent_server/aiohmi/redfish/oem/lenovo/tsma.py +++ b/confluent_server/aiohmi/redfish/oem/lenovo/tsma.py @@ -101,8 +101,8 @@ class TsmHandler(generic.OEMHandler): @classmethod async def create(cls, sysinfo, sysurl, webclient, cache=None, fish=None, gpool=None): - self = await super(TsmHandler, cls).create(sysinfo, sysurl, webclient, cache, fish, - gpool) + self = await super(TsmHandler, cls).create(sysinfo, sysurl, webclient, cache, + gpool=gpool) if cache is None: cache = {} self._wc = None diff --git a/confluent_server/aiohmi/redfish/oem/lookup.py b/confluent_server/aiohmi/redfish/oem/lookup.py index 210f2dc2..4f528f8d 100644 --- a/confluent_server/aiohmi/redfish/oem/lookup.py +++ b/confluent_server/aiohmi/redfish/oem/lookup.py @@ -27,23 +27,23 @@ OEMMAP = { } -def get_oem_handler(sysinfo, sysurl, webclient, cache, cmd, rootinfo={}): +async def get_oem_handler(sysinfo, sysurl, webclient, cache, cmd, rootinfo={}): if rootinfo.get('Vendor', None) in OEMMAP: - return OEMMAP[rootinfo['Vendor']].get_handler(sysinfo, sysurl, - webclient, cache, cmd, rootinfo) + return await OEMMAP[rootinfo['Vendor']].get_handler(sysinfo, sysurl, + webclient, cache, cmd, rootinfo) for oem in sysinfo.get('Oem', {}): if oem in OEMMAP: - return OEMMAP[oem].get_handler(sysinfo, sysurl, webclient, cache, - cmd, rootinfo) + return await OEMMAP[oem].get_handler(sysinfo, sysurl, webclient, cache, + cmd, rootinfo) for oem in sysinfo.get('Links', {}).get('OEM', []): if oem in OEMMAP: - return OEMMAP[oem].get_handler(sysinfo, sysurl, webclient, cache, - cmd, rootinfo) + return await OEMMAP[oem].get_handler(sysinfo, sysurl, webclient, cache, + cmd, rootinfo) if rootinfo: # rootinfo indicates early invocation, bmcinfo not ready yet - return generic.OEMHandler(sysinfo, sysurl, webclient, cache, cmd._gpool, rootinfo) - bmcinfo = cmd.bmcinfo + return await generic.OEMHandler.create(sysinfo, sysurl, webclient, cache, cmd._gpool, rootinfo) + bmcinfo = await cmd.bmcinfo() for oem in bmcinfo.get('Oem', {}): if oem in OEMMAP: - return OEMMAP[oem].get_handler(sysinfo, sysurl, webclient, cache, - cmd, rootinfo) - return generic.OEMHandler(sysinfo, sysurl, webclient, cache, cmd._gpool, rootinfo) + return await OEMMAP[oem].get_handler(sysinfo, sysurl, webclient, cache, + cmd, rootinfo) + return await generic.OEMHandler.create(sysinfo, sysurl, webclient, cache, cmd._gpool, rootinfo)