From bf2ca02e06c93be9617cd0626049f7439b2192c1 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Sun, 4 Dec 2022 21:55:37 -0500 Subject: [PATCH] [syseeprom] Remove the trailing space in the value of VENDOR_EXT field in the eepromTlvInfo decode (#333) Description The VEMDOR_EXT field parse the data and format each in byte in hex with space as separator. But the logic leaves a space at the end of the value. This PR removes the trailing space in output of the VENDOR_EXT field in the eepromTlvInfo decode This change is needed by 202205 branch Motivation and Context The trailing space at end of the VENDOR_EXT field cause the test of function get_system_eeprom_info() failed. The trailing space of the data filed is invisible char in the show platform syseeprom output while the get_system_eeprom_info() return a dictionary with trailing space in the end. This results in a mis-matched in the test case. Signed-off-by: mlok --- sonic_platform_base/sonic_eeprom/eeprom_tlvinfo.py | 1 + 1 file changed, 1 insertion(+) diff --git a/sonic_platform_base/sonic_eeprom/eeprom_tlvinfo.py b/sonic_platform_base/sonic_eeprom/eeprom_tlvinfo.py index 0961458cceda..e81e16444df8 100644 --- a/sonic_platform_base/sonic_eeprom/eeprom_tlvinfo.py +++ b/sonic_platform_base/sonic_eeprom/eeprom_tlvinfo.py @@ -490,6 +490,7 @@ def decoder(self, s, t): if self._TLV_DISPLAY_VENDOR_EXT: for c in t[2:2 + t[1]]: value += "0x%02X " % c + value = value.rstrip() elif t[0] == self._TLV_CODE_CRC_32 and len(t) == 6: name = "CRC-32" value = "0x%08X" % ((t[2] << 24) | (t[3] << 16) | (t[4] << 8) | t[5])