Another fix for non-zero LUN

Accidentally did not have it treated properly
in add_sdr and get_sensor_data.

Change-Id: I5b55de6baf393fdfb686f6a574fee874e610a9a0
This commit is contained in:
Jarrod Johnson
2020-02-28 15:39:09 -05:00
parent b497af048f
commit 39a1fa0985
2 changed files with 5 additions and 2 deletions

View File

@@ -962,7 +962,10 @@ class Command(object):
"""
self.init_sdr()
for sensor in self._sdr.get_sensor_numbers():
rsp = self.raw_command(command=0x2d, netfn=4, data=(sensor,))
currsensor = self._sdr.sensors[sensor]
rsp = self.raw_command(command=0x2d, netfn=4,
lun=currsensor.sensor_lun,
data=(currsensor.sensor_number,))
if 'error' in rsp:
if rsp['code'] == 203: # Sensor does not exist, optional dev
continue

View File

@@ -804,7 +804,7 @@ class SDR(object):
def add_sdr(self, sdrbytes):
newent = SDREntry(sdrbytes, self.ipmicmd)
if newent.sdrtype == TYPE_SENSOR:
id = newent.sensor_number
id = '{0}.{1}'.format(newent.sensor_number, newent.sensor_lun)
if id in self.sensors:
self.broken_sensor_ids[id] = True
return