2
0
mirror of https://opendev.org/x/pyghmi synced 2025-09-19 00:08:10 +00:00

Fix exceptions on sdr read

The string formatting is corrected for some 'bmc' errors.
It has been suggested to restructure things to not complain,
but so far when investigated, the systems actually had
a defect in putting the wrong sensor number in.  As a
diagnostic aid, this seems to be useful.  If a legitimate
application of duplicate SDR record for sensor is pointed
out, then we can restructure.

Change-Id: I58c2ffc1108cbb157f1398b420ea3a24bc4f05e8
This commit is contained in:
Jarrod Johnson
2015-02-17 13:13:20 -05:00
parent af02266b0b
commit b4f265b2d7

View File

@@ -677,12 +677,12 @@ class SDR(object):
if newent.sdrtype == TYPE_SENSOR:
id = newent.sensor_number
if id in self.sensors:
raise exc.BmcErrorException("Duplicate sensor number " + id)
raise exc.BmcErrorException("Duplicate sensor number %d" % id)
self.sensors[id] = newent
elif newent.sdrtype == TYPE_FRU:
id = newent.fru_number
if id in self.fru:
raise exc.BmcErrorException("Duplicate FRU identifier " + id)
raise exc.BmcErrorException("Duplicate FRU identifier %d" % id)
self.fru[id] = newent
def decode_aux(self, auxdata):