From 39a1fa0985f753908397e01abd3fab60d3cd9a0a Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Fri, 28 Feb 2020 15:39:09 -0500 Subject: [PATCH] Another fix for non-zero LUN Accidentally did not have it treated properly in add_sdr and get_sensor_data. Change-Id: I5b55de6baf393fdfb686f6a574fee874e610a9a0 --- pyghmi/ipmi/command.py | 5 ++++- pyghmi/ipmi/sdr.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pyghmi/ipmi/command.py b/pyghmi/ipmi/command.py index 5233614d..a401b35e 100644 --- a/pyghmi/ipmi/command.py +++ b/pyghmi/ipmi/command.py @@ -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 diff --git a/pyghmi/ipmi/sdr.py b/pyghmi/ipmi/sdr.py index 75c965af..8e816d43 100644 --- a/pyghmi/ipmi/sdr.py +++ b/pyghmi/ipmi/sdr.py @@ -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