mirror of
https://opendev.org/x/pyghmi
synced 2026-03-31 23:33:34 +00:00
Accept utf8 strings in FRU data
https: //gitlab.icelab.lenovo.com/pygcon/pyghmi/commit/09b93e84ba2093ccbd2f7536832cbcf8c15a6abc Accept utf-8 strings in FRU data Some ThinkServers have FRU elements that can return unicode strings. This patch adds support for this data. Change-Id: If64cee6d132272ef1756dfcbdd1e056fafd2a3c2
This commit is contained in:
@@ -548,13 +548,13 @@ class OEMHandler(generic.OEMHandler):
|
||||
try:
|
||||
_, _, wwn1, wwn2, mac1, mac2 = fru['board_extra']
|
||||
if wwn1 not in ('0000000000000000', ''):
|
||||
fru['WWN 1'] = wwn1
|
||||
fru['WWN 1'] = wwn1.encode('utf-8')
|
||||
if wwn2 not in ('0000000000000000', ''):
|
||||
fru['WWN 2'] = wwn2
|
||||
fru['WWN 2'] = wwn2.encode('utf-8')
|
||||
if mac1 not in ('00:00:00:00:00:00', ''):
|
||||
fru['MAC Address 1'] = mac1
|
||||
fru['MAC Address 1'] = mac1.encode('utf-8')
|
||||
if mac2 not in ('00:00:00:00:00:00', ''):
|
||||
fru['MAC Address 2'] = mac2
|
||||
fru['MAC Address 2'] = mac2.encode('utf-8')
|
||||
except (AttributeError, KeyError):
|
||||
pass
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user