sonic-buildimage/platform
Sudharsan Dhamal Gopalarathnam 23d68883f5
[Mellanox]Check dmi file permission before access (#11309)
Signed-off-by: Sudharsan Dhamal Gopalarathnam sudharsand@nvidia.com

Why I did it
During the system boot up when 'show platform status' or 'show version' command is executed before STATE_DB CHASSIS_INFO table is populated, the show will try to fallback to use the platform API. The DMI file in mellanox platforms require root permission for access. So if the show commands are executed as admin or any other user, the following error log will appear in the syslog

Jun 28 17:21:25.612123 sonic ERR show: Fail to decode DMI /sys/firmware/dmi/entries/2-0/raw due to PermissionError(13, 'Permission denied')

How I did it
Check the file permission before accessing it.

How to verify it
Added UT to verify. Manually verified if the error log is not thrown.
2022-07-01 17:29:07 -07:00
..
barefoot [Netberg][Barefoot] Added support for Aurora 610 (#10579) 2022-06-30 10:40:47 -07:00
broadcom DellEMC Z9332f: 'update_firmware' component API return False if firmware image not found (#10797) 2022-06-29 09:30:58 -07:00
cavium Parallel building of sonic dockers using native dockerd(dood). (#10352) 2022-04-28 08:39:37 +08:00
centec [centec]: fix docker syncd rpc compile(#11097) 2022-06-16 15:27:57 -07:00
centec-arm64 [centec]: fix docker syncd rpc compile(#11097) 2022-06-16 15:27:57 -07:00
checkout Platform/cisco-8000 module for sonic-buildimage (#8172) 2021-08-06 09:11:54 +08:00
components Upgrade gbsyncd container to bullseye (#11288) 2022-06-30 15:54:36 +08:00
generic [dockers] Rename 'docker-snmp-sv2' to 'docker-snmp' (#4699) 2020-06-11 16:04:23 -07:00
innovium [Wistron] Add 6512-32r platform support (#10956) 2022-06-30 09:13:56 -07:00
marvell [bcm sai] upgrade Broadcom SAI to 7.1.0.0-5 (#11236) 2022-06-23 15:34:51 -07:00
marvell-arm64 Support symcrypt fips config for aboot/uboot (#10729) 2022-06-02 15:35:17 +08:00
marvell-armhf [Marvell] Update armhf sai deb (#11296) 2022-06-30 13:21:30 -07:00
mellanox [Mellanox]Check dmi file permission before access (#11309) 2022-07-01 17:29:07 -07:00
nephos Parallel building of sonic dockers using native dockerd(dood). (#10352) 2022-04-28 08:39:37 +08:00
p4 Parallel building of sonic dockers using native dockerd(dood). (#10352) 2022-04-28 08:39:37 +08:00
pddf Fix for Accton platform build failure when doing incremental build (#10541) 2022-05-09 12:17:38 -07:00
template Upgrade gbsyncd container to bullseye (#11288) 2022-06-30 15:54:36 +08:00
vs Upgrade gbsyncd container to bullseye (#11288) 2022-06-30 15:54:36 +08:00