sonic-buildimage/platform/mellanox/mlnx-platform-api
Sasha 26bc08850b
Check if PSU files exists when getting psu_voltage properties (#17042)
- Why I did it
Error messages occured when trying to read PSU files on init:
ERR pmon#psud: Failed to read from file /var/run/hw-management/power/psu1_volt_out2_capability - FileNotFoundError(2, 'No such file or directory')

This can happen when the power cord is disconnected from the PSU, so some PSU files may be absent, e.g.:
/var/run/hw-management/power/psu2_volt_out2
/var/run/hw-management/power/psu2_volt_out2_capability

- How I did it
Check if a file exists for a specific PSU parameter If not, return None so we can't read the PSU file any further

- How to verify it
Disconnect power cord from PSU and power supply from system
Wait few minutes and then connect power supply to system without power cord
Check logs for errors

Signed-off-by: Oleksandra Bella <oleksandrab@nvidia.com>
2024-03-04 19:35:06 +02:00
..
sonic_platform Check if PSU files exists when getting psu_voltage properties (#17042) 2024-03-04 19:35:06 +02:00
tests [Mellanox] Fix issues found for CMIS host management (#17637) 2024-01-04 09:42:33 +02:00
.gitignore [Mellanox] Refactor Mellanox platform API to support dynamic port configuration (#8422) 2021-10-25 07:59:06 +03:00
pytest.ini [Mellanox] Refactor Mellanox platform API to support dynamic port configuration (#8422) 2021-10-25 07:59:06 +03:00
setup.cfg Add thermal control support for SONiC (#3949) 2020-03-09 10:41:10 -07:00
setup.py [Mellanox] Add NVIDIA Copyright header to "mellanox" files (#8799) 2021-10-17 19:03:02 +03:00