From e3f187d1857e2a895e51331a6562ac657649ebb5 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 1 Mar 2024 14:09:51 -0500 Subject: [PATCH] Extent redfish inventory enumeration of XCC Have the inventory explicitly cover the memory and processors. Change-Id: I9fcb85f21a460c45285ec80c06093a077751a3c1 --- pyghmi/redfish/oem/generic.py | 4 ++-- pyghmi/redfish/oem/lenovo/xcc.py | 12 +++++++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pyghmi/redfish/oem/generic.py b/pyghmi/redfish/oem/generic.py index 8f989e09..743c6eaa 100644 --- a/pyghmi/redfish/oem/generic.py +++ b/pyghmi/redfish/oem/generic.py @@ -781,12 +781,12 @@ class OEMHandler(object): def update_firmware(self, filename, data=None, progress=None, bank=None): usd = self._do_web_request('/redfish/v1/UpdateService') if usd.get('HttpPushUriTargetsBusy', False): - raise pygexc.TemporaryError('Cannot run multtiple updates to ' + raise exc.TemporaryError('Cannot run multtiple updates to ' 'same target concurrently') try: upurl = usd['HttpPushUri'] except KeyError: - raise pygexc.UnsupportedFunctionality('Redfish firmware update only supported for implementations with push update support') + raise exc.UnsupportedFunctionality('Redfish firmware update only supported for implementations with push update support') if 'HttpPushUriTargetsBusy' in usd: self._do_web_request( '/redfish/v1/UpdateService', diff --git a/pyghmi/redfish/oem/lenovo/xcc.py b/pyghmi/redfish/oem/lenovo/xcc.py index e093dd6c..2d883834 100644 --- a/pyghmi/redfish/oem/lenovo/xcc.py +++ b/pyghmi/redfish/oem/lenovo/xcc.py @@ -1646,6 +1646,11 @@ class OEMHandler(generic.OEMHandler): yield "System" for key in natural_sort(hwmap): yield key + for cpuinv in self._get_cpu_inventory(): + yield cpuinv[0] + for meminv in self._get_mem_inventory(): + yield meminv[0] + def get_inventory_of_component(self, compname): if compname.lower() == 'system': @@ -1662,7 +1667,12 @@ class OEMHandler(generic.OEMHandler): try: return hwmap[compname] except KeyError: - + for cpuinv in self._get_cpu_inventory(): + if cpuinv[0] == compname: + return cpuinv[1] + for meminv in self._get_mem_inventory(): + if meminv[0] == compname: + return meminv[1] return None def get_inventory(self, withids=False):