From 59d794595707f2f2ede6566568003546393a7279 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 11 Jun 2015 13:36:31 -0400 Subject: [PATCH] Handle Lenovo Thinkserver lacking OEM inventory If a Thinkserver responds negatively to request for OEM inventory data, gracefully drop out and return empty information rather than passing it up the stack. Change-Id: I16d176606bb95d56244dfea43f9d828ff046bbc1 --- pyghmi/ipmi/oem/lenovo.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pyghmi/ipmi/oem/lenovo.py b/pyghmi/ipmi/oem/lenovo.py index 15b840f4..16d51ebe 100644 --- a/pyghmi/ipmi/oem/lenovo.py +++ b/pyghmi/ipmi/oem/lenovo.py @@ -15,6 +15,7 @@ # limitations under the License. import pyghmi.constants as pygconst +import pyghmi.exceptions as pygexc import pyghmi.ipmi.oem.generic as generic import pyghmi.ipmi.private.constants as ipmiconst import pyghmi.ipmi.private.spd as spd @@ -222,8 +223,11 @@ class OEMHandler(generic.OEMHandler): def _collect_tsm_inventory(self): # Collect CPU inventory self.oem_inventory_info = {} - rsp = self.ipmicmd.xraw_command(netfn=6, command=0x59, - data=(0, 0xc1, 1, 0)) + try: + rsp = self.ipmicmd.xraw_command(netfn=6, command=0x59, + data=(0, 0xc1, 1, 0)) + except pygexc.IpmiException: + return compcount = ord(rsp['data'][1]) for cpu in xrange(0, compcount): offset = 2 + (85 * cpu)