mirror of
				https://opendev.org/x/pyghmi
				synced 2025-10-31 03:12:24 +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:
		| @@ -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: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user