2
0
mirror of https://opendev.org/x/pyghmi synced 2025-08-24 12:00:21 +00:00

Fix crash on missing "board_extra" field in FRU response

Change-Id: I9fc95282926ef9a7f3847f38116736dabea5c3bb
This commit is contained in:
Allan Vidal
2015-10-23 10:21:14 -02:00
parent e96bd8f67c
commit c692005b5a

View File

@@ -323,15 +323,18 @@ class OEMHandler(generic.OEMHandler):
fru['oem_parser'] = 'lenovo'
# Thinkserver lays out specific interpretation of the
# board extra fields
_, _, wwn1, wwn2, mac1, mac2 = fru['board_extra']
if wwn1 not in ('0000000000000000', ''):
fru['WWN 1'] = wwn1
if wwn2 not in ('0000000000000000', ''):
fru['WWN 2'] = wwn2
if mac1 not in ('00:00:00:00:00:00', ''):
fru['MAC Address 1'] = mac1
if mac2 not in ('00:00:00:00:00:00', ''):
fru['MAC Address 2'] = mac2
try:
_, _, wwn1, wwn2, mac1, mac2 = fru['board_extra']
if wwn1 not in ('0000000000000000', ''):
fru['WWN 1'] = wwn1
if wwn2 not in ('0000000000000000', ''):
fru['WWN 2'] = wwn2
if mac1 not in ('00:00:00:00:00:00', ''):
fru['MAC Address 1'] = mac1
if mac2 not in ('00:00:00:00:00:00', ''):
fru['MAC Address 2'] = mac2
except (AttributeError, KeyError):
pass
try:
# The product_extra field is UUID as the system would present
# in DMI. This is different than the two UUIDs that