From a676ff3beff60873427f249d66c9b99ed3bd2309 Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Wed, 6 Sep 2017 11:49:48 -0400 Subject: [PATCH] Remove NUL bytes from SMM serial/model The data may contain NUL bytes, make sure strip removes them. Change-Id: I3bfea4ac85fb696e30a6b990e9fa167b4005edab --- pyghmi/ipmi/oem/lenovo/nextscale.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pyghmi/ipmi/oem/lenovo/nextscale.py b/pyghmi/ipmi/oem/lenovo/nextscale.py index d382457f..ef993e04 100644 --- a/pyghmi/ipmi/oem/lenovo/nextscale.py +++ b/pyghmi/ipmi/oem/lenovo/nextscale.py @@ -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):