From 0bdf26f8c9c07f931d41d537d1f3159daa1124e7 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Thu, 21 Mar 2019 09:47:17 -0400 Subject: [PATCH] Fix mistake in IMM set property There was a mistake in the code to attempt length calculation. Change-Id: I62dbd78ec11095d897433754a5751c02fd0d5812 --- pyghmi/ipmi/oem/lenovo/imm.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index 38e1dd78..64f66b7f 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -265,8 +265,8 @@ class IMMClient(object): raise Exception('Unsupported property value') propname = propname.encode('utf-8') proplen = len(propname) | 0b10000000 - valuelen = 0x11 - cmdlen = len(propname) + len(valuelen) + 3 + valuelen = 0x11 # The value is always one byte, for now + cmdlen = len(propname) + 4 # the flags byte, two tlv bytes, and value cdata = bytearray([3, 0, cmdlen, 1, proplen]) + propname cdata += bytearray([valuelen, value]) rsp = self.ipmicmd.xraw_command(netfn=0x3a, command=0xc4, data=cdata)