2
0
mirror of https://opendev.org/x/pyghmi synced 2026-03-31 23:33:34 +00:00

Fix KeyError due to lazy use of raw_command

xraw_command is the version intended to be lazily
used, switch to that version to make the SDR code
more robust.

Change-Id: I1e9b799dd21861fa602db6a1d474334e88915c38
This commit is contained in:
Jarrod Johnson
2016-05-25 15:06:06 -04:00
parent d672a82a19
commit eb86ea1ff8

View File

@@ -592,7 +592,8 @@ class SDR(object):
def read_info(self):
#first, we want to know the device id
rsp = self.ipmicmd.raw_command(netfn=6, command=1)
rsp = self.ipmicmd.xraw_command(netfn=6, command=1)
rsp['data'] = bytearray(rsp['data'])
self.device_id = rsp['data'][0]
self.device_rev = rsp['data'][1] & 0b111
# Going to ignore device available until get sdr command
@@ -619,7 +620,8 @@ class SDR(object):
return rsp['data'][0] + (rsp['data'][1] << 8)
def get_sdr(self):
repinfo = self.ipmicmd.raw_command(netfn=0x0a, command=0x20)
repinfo = self.ipmicmd.xraw_command(netfn=0x0a, command=0x20)
repinfo['data'] = bytearray(repinfo['data'])
if (repinfo['data'][0] != 0x51):
# we only understand SDR version 51h, the only version defined
# at time of this writing