From 3db5df1b4a572d6a5f79c92c3a476c4f38961587 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 19 May 2015 16:51:29 -0400 Subject: [PATCH] Fix behavior with some Lenovo Thinkservers FRU data may return 0x81 on not-present devices and also provide some rough event description in the case of an unknown OEM SEL format. Change-Id: Ia99c4981c06ed8e067a584896fde3880f08f8baa --- pyghmi/ipmi/fru.py | 3 ++- pyghmi/ipmi/oem/lenovo.py | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pyghmi/ipmi/fru.py b/pyghmi/ipmi/fru.py index 4a4d42bf..0fe32aba 100644 --- a/pyghmi/ipmi/fru.py +++ b/pyghmi/ipmi/fru.py @@ -132,8 +132,9 @@ class FRU(object): try: self.fetch_fru(fruid) except iexc.IpmiException as ie: - if ie.ipmicode == 203: + if ie.ipmicode in (203, 129): return + raise self.parsedata() else: raise TypeError('Either rawdata or ipmicmd must be specified') diff --git a/pyghmi/ipmi/oem/lenovo.py b/pyghmi/ipmi/oem/lenovo.py index 26df7304..cd2e197b 100644 --- a/pyghmi/ipmi/oem/lenovo.py +++ b/pyghmi/ipmi/oem/lenovo.py @@ -26,6 +26,9 @@ class OEMHandler(generic.OEMHandler): self.oemid = oemid def process_event(self, event): + if 'oemdata' in event: + event['event'] = 'OEM event: {0}'.format(repr(event['oemdata'])) + return evdata = event['event_data_bytes'] # For HDD bay events, the event data 2 is the bay, modify # the description to be more specific