2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-22 17:43:14 +00:00

Do not process incomplete DIMM info

A malformed SPD given by BMC is now presented as Unrecognized,
rather than trying to format data that does not exist.
This commit is contained in:
Jarrod Johnson 2017-10-18 09:51:31 -04:00
parent d26f6259a7
commit ffaabd5ae3

View File

@ -46,14 +46,17 @@ def pretty(text):
return text
def print_mem_info(node, prefix, meminfo):
capacity = meminfo['capacity_mb'] / 1024
memdescfmt = '{0}GB PC'
if meminfo['memory_type'] == 'DDR3 SDRAM':
memdescfmt += '3-{1} '
elif meminfo['memory_type'] == 'DDR4 SDRAM':
memdescfmt += '4-{1} '
elif meminfo['memory_type'] == 'Unknown':
print('{0}: Unrecognized Memory'.format(node))
return
if meminfo['ecc']:
memdescfmt += 'ECC '
capacity = meminfo['capacity_mb'] / 1024
memdescfmt += meminfo['module_type']
memdesc = memdescfmt.format(capacity, meminfo['speed'])
print('{0}: {1} description: {2}'.format(node, prefix, memdesc))