2
0
mirror of https://opendev.org/x/pyghmi synced 2026-03-31 23:33:34 +00:00

Merge "Add optane dimm for XCC systems"

This commit is contained in:
Zuul
2021-10-06 13:20:04 +00:00
committed by Gerrit Code Review
2 changed files with 23 additions and 0 deletions

View File

@@ -738,6 +738,9 @@ class OEMHandler(generic.OEMHandler):
pass
if self.has_xcc and name and name.startswith('PSU '):
self.immhandler.augment_psu_info(fru, name)
if (self.has_xcc and 'memory_type' in fru
and fru['memory_type'] == 'Unknown'):
self.immhandler.fetch_dimm(name, fru)
return fru
elif self.is_fpc and self.is_fpc != 6: # SMM variant
fru['oem_parser'] = 'lenovo'

View File

@@ -867,6 +867,26 @@ class XCCClient(IMMClient):
raise pygexc.UnsupportedFunctionality(
'This platform does not support AC reseat.')
def fetch_dimm(self, name, fru):
meminfo = self.grab_cacheable_json('/api/dataset/imm_memory')
meminfo = meminfo.get('items', [{}])[0].get('memory', [])
for memi in meminfo:
if memi.get('memory_description', None) == name:
fru['model'] = memi['memory_part_number']
fru['ecc'] = memi.get('memory_ecc_bits', 0) != 0
fru['manufacture_location'] = 0
fru['memory_type'] = memi['memory_type']
fru['module_type'] = fru['memory_type']
mdate = memi['memory_manuf_date']
mdate = '20{}-W{}'.format(mdate[-2:], mdate[:-2])
fru['manufacture_date'] = mdate
speed = memi['memory_config_speed'] * 8 / 100 * 100
fru['speed'] = speed
fru['capacity_mb'] = memi['memory_capacity'] * 1024
fru['serial'] = memi['memory_serial_number'].strip()
fru['manufacturer'] = memi['memory_manufacturer']
break
def get_description(self):
dsc = self.wc.grab_json_response('/DeviceDescription.json')
dsc = dsc[0]