From 167e256fa0a0851a04918d8211d596ef6eb95888 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 16 Jun 2021 08:47:53 -0400 Subject: [PATCH] Tolerate more standard variations There are more variations on key parameters, tolerate the distinct responses consistent with existing replies of similar purpose. Change-Id: I22c3ecf7b78213cc9b0c1b8c88deb91251c1facd --- pyghmi/ipmi/command.py | 7 ++++++- pyghmi/ipmi/fru.py | 2 +- pyghmi/redfish/oem/generic.py | 27 ++++++++++++++++++++------- 3 files changed, 27 insertions(+), 9 deletions(-) diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index 1f588e83..acea5358 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -771,7 +771,12 @@ class Command(object): one byte, return the int value """ fetchcmd = bytearray((channel, param, 0, 0)) - fetched = self.xraw_command(0xc, 2, data=fetchcmd) + try: + fetched = self.xraw_command(0xc, 2, data=fetchcmd) + except exc.IpmiException as ie: + if ie.ipmicode == 0x80: + return None + raise fetchdata = fetched['data'] if bytearray(fetchdata)[0] != 17: return None diff --git a/pyghmi/ipmi/fru.py b/pyghmi/ipmi/fru.py index abdd291d..c48d0bf1 100644 --- a/pyghmi/ipmi/fru.py +++ b/pyghmi/ipmi/fru.py @@ -133,7 +133,7 @@ class FRU(object): try: self.fetch_fru(fruid) except iexc.IpmiException as ie: - if ie.ipmicode in (203, 129): + if ie.ipmicode in (195, 201, 203, 129): return raise self.parsedata() diff --git a/pyghmi/redfish/oem/generic.py b/pyghmi/redfish/oem/generic.py index 480d8615..ca587c6d 100644 --- a/pyghmi/redfish/oem/generic.py +++ b/pyghmi/redfish/oem/generic.py @@ -118,19 +118,32 @@ class OEMHandler(object): } yield ('System', sysinfo) self._hwnamemap = {} + cpumemurls = [] memurl = self._varsysinfo.get('Memory', {}).get('@odata.id', None) + if memurl: + cpumemurls.append(memurl) cpurl = self._varsysinfo.get('Processors', {}).get('@odata.id', None) - list(self._do_bulk_requests([memurl, cpurl])) + if cpurl: + cpumemurls.append(cpurl) + list(self._do_bulk_requests(cpumemurls)) adpurls = self._get_adp_urls() - cpurls = self._get_cpu_urls() - memurls = self._get_mem_urls() + if cpurl: + cpurls = self._get_cpu_urls() + else: + cpurls = [] + if memurl: + memurls = self._get_mem_urls() + else: + memurls = [] diskurls = self._get_disk_urls() allurls = adpurls + cpurls + memurls + diskurls list(self._do_bulk_requests(allurls)) - for cpu in self._get_cpu_inventory(withids=withids, urls=cpurls): - yield cpu - for mem in self._get_mem_inventory(withids=withids, urls=memurls): - yield mem + if cpurl: + for cpu in self._get_cpu_inventory(withids=withids, urls=cpurls): + yield cpu + if memurl: + for mem in self._get_mem_inventory(withids=withids, urls=memurls): + yield mem for adp in self._get_adp_inventory(withids=withids, urls=adpurls): yield adp for disk in self._get_disk_inventory(withids=withids, urls=diskurls):