diff --git a/pyghmi/ipmi/oem/lenovo/imm.py b/pyghmi/ipmi/oem/lenovo/imm.py index f524aa27..93787b0c 100644 --- a/pyghmi/ipmi/oem/lenovo/imm.py +++ b/pyghmi/ipmi/oem/lenovo/imm.py @@ -44,6 +44,11 @@ def fixup_uuid(uuidprop): return '-'.join(uuid).upper() +def fixup_str(propstr): + return ''.join([chr(int(c, 16)) for c in propstr.split()]).strip( + ' \xff\x00') + + class FileUploader(threading.Thread): def __init__(self, webclient, url, filename, data): @@ -425,9 +430,13 @@ class IMMClient(object): enclosureuuid = self.get_property('/v2/ibmc/smm/chassis/uuid') if enclosureuuid: bay = self.get_property('/v2/cmm/sp/7') + serial = self.get_property('/v2/ibmc/smm/chassis/sn') + model = self.get_property('/v2/ibmc/smm/chassis/mtm') hwmap['Enclosure'] = { 'UUID': fixup_uuid(enclosureuuid), 'Bay': bay, + 'Model': fixup_str(model), + 'Serial': fixup_str(serial), } adapterdata = self.get_cached_data('lenovo_cached_adapters') if not adapterdata: