sonic-buildimage/platform/broadcom/sonic-platform-modules-cel
Xin Wang 9fe128c8e8
Fix issue of parsing syseeprom value with whitespace in middle (#10021)
Fixes #10020

Why I did it
The platform api for parsing syseeprom information read from STATE DB has issue
with parsing the value part that has whitespace in the middle. The current
code assumes that the value part does not have whitespace. So everything after
the whitespace will be ignored. The syseeprom values returned from platform
API do not match the output of "show platform syseeprom".

How I did it
This change improved the regular expression for parsing syseeprom values to
accommodate whitespaces in the value.

How to verify it
Locally updated the code on a dx010 device. Call the platform API:
```
>>> import sonic_platform
>>> platform = sonic_platform.platform.Platform()
>>> chassis = platform.get_chassis()
>>> chassis.get_system_eeprom_info()
{'0x21': 'DX010', '0x22': 'R0872-F0020-02', '0x23': 'DX010B2F030A27BY200002', '0x24': '00:E0:EC:E7:71:0F', '0x25': '11/03/2020 21:22:56', '0x26': '3', '0x27': 'Seastone', '0x28': 'RANGELEY', '0x29': '2014.08', '0x2A': '131', '0x2B': 'CELESTICA', '0x2C': 'THA', '0x2D': 'Celestica', '0x2E': '1.0.5', '0x2F': 'LB', '0xFD': '', '0xFE': '0xAAB39BDB'}
```

Signed-off-by: Xin Wang <xiwang5@microsoft.com>
2022-02-23 10:33:34 +08:00
..
debian [Celestica Seastone2] Build correct platform files (#9660) 2022-01-16 12:11:28 +05:30
dx010 Update SAI module for Celestica for Bullseye and 5.10 kernel 2021-11-10 15:27:22 -08:00
haliburton Update SAI module for Celestica for Bullseye and 5.10 kernel 2021-11-10 15:27:22 -08:00
seastone2 Update SAI module for Celestica for Bullseye and 5.10 kernel 2021-11-10 15:27:22 -08:00
services Fix issue of parsing syseeprom value with whitespace in middle (#10021) 2022-02-23 10:33:34 +08:00
silverstone Update SAI module for Celestica for Bullseye and 5.10 kernel 2021-11-10 15:27:22 -08:00
.gitignore [build]: add .gitignore for cel, delta and inventec 2018-08-11 09:09:03 +00:00
LICENSE [platform]: incorporate sonic-platform-modules-cel into sonic buildimage repo 2018-08-11 09:09:03 +00:00
README.md [Celestica/Seastone2] Add support Seastone2 device and platform (#3761) 2020-01-15 18:42:09 -08:00

platform drivers of Celestica network switchs for the SONiC project