mirror of
https://opendev.org/x/pyghmi
synced 2025-08-09 12:50:16 +00:00
Fix localsession for python2
Commands without data were causing problems for python2 ctypes interface. Skip the copy attempt when there is no data to copy. Change-Id: If115a1145c277992aa4ffbe420a582dc08d0926e
This commit is contained in:
@@ -122,7 +122,8 @@ class Session(object):
|
||||
self.req.msg.netfn = netfn
|
||||
self.req.msg.cmd = command
|
||||
data = memoryview(bytearray(data))
|
||||
self.databuffer[:len(data)] = data[:len(data)]
|
||||
if data:
|
||||
self.databuffer[:len(data)] = data[:len(data)]
|
||||
self.req.msg.data_len = len(data)
|
||||
fcntl.ioctl(self.ipmidev, IPMICTL_SEND_COMMAND, self.req)
|
||||
self.await_reply()
|
||||
|
Reference in New Issue
Block a user