

def get_imm_property(ipmicmd, propname):
    propname = propname.encode('utf-8')
    proplen = (len(propname) | 128)
    cmdlen = (len(propname) + 1)
    cdata = (bytearray([0, 0, cmdlen, proplen]) + propname)
    rsp = ipmicmd.xraw_command(netfn=58, command=196, data=propname)
    rsp['data'] = bytearray(rsp['data'])
    if (rsp['data'][0] != 0):
        return None
    propdata = rsp['data'][3:]
    if (propdata[0] & 128):
        return str(propdata[1:]).rstrip(' \x00')
    else:
        raise Exception(('Unknown format for property: ' + repr(propdata)))

dataset/ETHPy150Open openstack/pyghmi/pyghmi/ipmi/oem/lenovo/imm.py get_imm_property/VarMisuse@78/102 `cdata`->`propname`