From 68c7979349f8ef34f37b4fd691dce2fb14d8def0 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 23 Oct 2015 16:17:12 -0400 Subject: [PATCH] Handle missing UUID Some TSM FRU elements do not have a FRU entry. They may be marked by all spaces, all 0xff, or all 0x00. Skip UUID if it is one of these obviously invalid values. Change-Id: I90c8bbe3c66754bcb6d6200b63a2ff2c29ae63ec --- pyghmi/ipmi/oem/lenovo/handler.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pyghmi/ipmi/oem/lenovo/handler.py b/pyghmi/ipmi/oem/lenovo/handler.py index ae2ba543..dc47bd86 100755 --- a/pyghmi/ipmi/oem/lenovo/handler.py +++ b/pyghmi/ipmi/oem/lenovo/handler.py @@ -342,7 +342,8 @@ class OEMHandler(generic.OEMHandler): # to strip \x00 from the end of text strings. Work around this # by padding with \x00 to the right if less than 16 long byteguid.extend('\x00' * (16 - len(byteguid))) - fru['UUID'] = util.decode_wireformat_uuid(byteguid) + if byteguid not in ('\x20' * 16, '\x00' * 16, '\xff' * 16): + fru['UUID'] = util.decode_wireformat_uuid(byteguid) except (AttributeError, KeyError): pass return fru