From 9e47a44b9306702cdd6ec576811f761c22dfa869 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 30 Aug 2024 13:34:27 -0400 Subject: [PATCH] Use approved method to determine XCC vintage Use the model on the Manager instance to determine XCC 3 vs. prior generations. Change-Id: I2c192d6d1842af9a512396769e56a42e1cef14a7 --- pyghmi/redfish/oem/lenovo/main.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/pyghmi/redfish/oem/lenovo/main.py b/pyghmi/redfish/oem/lenovo/main.py index 676b0e10..8127e8b4 100644 --- a/pyghmi/redfish/oem/lenovo/main.py +++ b/pyghmi/redfish/oem/lenovo/main.py @@ -20,13 +20,22 @@ from pyghmi.redfish.oem.lenovo import xcc3 def get_handler(sysinfo, sysurl, webclient, cache, cmd): leninf = sysinfo.get('Oem', {}).get('Lenovo', {}) + mgrinfo = {} + if leninf: + mgrinf, status = webclient.grab_json_response_with_status('/redfish/v1/Managers/1') + if status != 200: + mgrinfo = {} if not leninf: bmcinfo = cmd.bmcinfo if 'Ami' in bmcinfo.get('Oem', {}): return tsma.TsmHandler(sysinfo, sysurl, webclient, cache) - elif 'NextOneTimeBootDevice' in leninf: - return xcc3.OEMHandler(sysinfo, sysurl, webclient, cache, - gpool=cmd._gpool) + elif 'xclarity controller' in mgrinf.get('Model', '').lower(): + if mgrinf['Model'].endswith('3'): + return xcc3.OEMHandler(sysinfo, sysurl, webclient, cache, + gpool=cmd._gpool) + else: + return xcc.OEMHandler(sysinfo, sysurl, webclient, cache, + gpool=cmd._gpool) elif 'FrontPanelUSB' in leninf or 'USBManagementPortAssignment' in leninf or sysinfo.get('SKU', '').startswith('7X58'): return xcc.OEMHandler(sysinfo, sysurl, webclient, cache, gpool=cmd._gpool)