Skip to content

Commit

Permalink
[syseeprom] Remove the trailing space in the value of VENDOR_EXT fiel…
Browse files Browse the repository at this point in the history
…d 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 <[email protected]>
  • Loading branch information
mlok-nokia authored Dec 5, 2022
1 parent 580357f commit bf2ca02
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sonic_platform_base/sonic_eeprom/eeprom_tlvinfo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit bf2ca02

Please sign in to comment.