2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-27 19:37:44 +00:00

Ignore KeyError on delete of missing sensor

The duplicate sensor code can result in an id that never
gets added.  As such, do not worry if trying to delete
something that is already not there.

Change-Id: I77af1054097d4225ad8bff68a046c6ed28791e9b
This commit is contained in:
Jarrod Johnson 2016-11-04 09:45:48 -04:00
parent 563b15decf
commit 2cfec95558

View File

@ -693,7 +693,10 @@ class SDR(object):
raise exc.BmcErrorException("Incorrect SDR record id from BMC")
recid = newrecid
for sid in self.broken_sensor_ids:
del self.sensors[sid]
try:
del self.sensors[sid]
except KeyError:
pass
def get_sensor_numbers(self):
return self.sensors.iterkeys()