2
0
mirror of https://opendev.org/x/pyghmi synced 2025-07-24 13:11:11 +00:00

Remove NUL bytes from SMM serial/model

The data may contain NUL bytes, make sure strip removes them.

Change-Id: I3bfea4ac85fb696e30a6b990e9fa167b4005edab
This commit is contained in:
Jarrod Johnson
2017-09-06 11:49:48 -04:00
parent 3627ba60d1
commit a676ff3bef

View File

@@ -243,11 +243,11 @@ class SMMClient(object):
def process_fru(self, fru):
# TODO(jjohnson2): can also get EIOM, SMM, and riser data if warranted
fru['Serial Number'] = self.ipmicmd.xraw_command(
netfn=0x32, command=0xb0, data=(5, 1))['data'][:].strip().replace(
'\xff', '')
netfn=0x32, command=0xb0, data=(5, 1))['data'][:].strip(
' \x00\xff').replace('\xff', '')
fru['Model'] = self.ipmicmd.xraw_command(
netfn=0x32, command=0xb0, data=(5, 0))['data'][:].strip().replace(
'\xff', '')
netfn=0x32, command=0xb0, data=(5, 0))['data'][:].strip(
' \x00\xff').replace('\xff', '')
return fru
def get_webclient(self):