2
0
mirror of https://opendev.org/x/pyghmi synced 2025-01-27 19:37:44 +00:00

Get additional enclosure data

Newer firmware provides more data about the enclosure.  Use this
to expand the details on the Enclosure inventory data.

Change-Id: I022934e89ae3dc109d7f94da617127c2695b98c7
This commit is contained in:
Jarrod Johnson 2018-03-15 14:18:37 -04:00
parent d506f5142f
commit d756743f40

View File

@ -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: