From 9b6e6b9ba0433bf02bec7fc603b04eb26fbe215f Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Mon, 26 Oct 2015 10:08:21 -0400 Subject: [PATCH] Do not raise on bad/unsupported FRU data If a FRU device presents data that pyghmi does not understand, treat it the same way as if it were not present, do not decode. Some systems simply do not have usable FRU data despite having a pointer to a FRU device. Change-Id: I440cee3366b5da4555b67b41492fa017dbe3dcef --- pyghmi/ipmi/fru.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/pyghmi/ipmi/fru.py b/pyghmi/ipmi/fru.py index 4995b894..f6ae6d52 100644 --- a/pyghmi/ipmi/fru.py +++ b/pyghmi/ipmi/fru.py @@ -186,16 +186,21 @@ class FRU(object): frutype = self.sdr.fru_type_and_modifier >> 8 frusubtype = self.sdr.fru_type_and_modifier & 0xff if frutype > 0x10 or frutype < 0x8 or frusubtype not in (0, 1, 2): - raise iexc.PyghmiException( - 'Unsupported FRU device: {0:x}h, {1:x}h'.format(frutype, - frusubtype - )) + return + #TODO(jjohnson2): strict mode to detect pyghmi and BMC + #gaps + # raise iexc.PyghmiException( + # 'Unsupported FRU device: {0:x}h, {1:x}h'.format(frutype, + # frusubtype + # )) elif frusubtype == 1: self.myspd = spd.SPD(self.databytes) self.info = self.myspd.info return if self.databytes[0] != 1: - raise iexc.BmcErrorException("Invalid/Unsupported FRU format") + return + #TODO(jjohnson2): strict mode to flag potential BMC errors + # raise iexc.BmcErrorException("Invalid/Unsupported FRU format") # Ignore the internal use even if present. self._parse_chassis() self._parse_board()