sonic-buildimage/platform/mellanox/mlnx-platform-api/sonic_platform
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
..
__init__.py [Mellanox] Add NVIDIA Copyright header to "mellanox" files (#8799) 2021-10-17 19:03:02 +03:00
chassis.py [Mellanox] Fix race condition while creating SFP (#17441) 2023-12-14 12:01:11 +02:00
component.py [Mellanox] Add more unit test coverage for platform API (#15842) 2023-08-03 13:54:31 +03:00
cpu_thermal_control.py [Mellanox] Add CPU thermal control for Nvidia platforms (#10202) 2022-03-21 09:54:52 -07:00
device_data.py [Mellanox] implement platform wait in python code (#17398) 2023-12-14 12:04:24 +02:00
eeprom.py [Mellanox] Extend the time to wait for EEPROM VPD file creation (#18146) 2024-02-29 15:46:49 +02:00
fan_drawer.py [Mellanox] add PSU fan direction support (#14508) 2023-05-15 21:34:54 +03:00
fan.py [Mellanox] Add N/A as a valid fan direction for Nvidia platforms (#17930) 2024-02-22 11:35:10 +02:00
led.py [Mellanox] Support UID LED in platform API (#11592) 2023-05-16 08:24:39 +03:00
module.py [Mellanox] Remove TODO comments which are no longer needed (#13023) 2022-12-14 09:57:48 +02:00
modules_mgmt.py [Mellanox] fix code for warm reboot to work with FW controlled ports (#18065) 2024-02-08 14:49:56 +02:00
pcie.py [Mellanox] Add NVIDIA Copyright header to "mellanox" files (#8799) 2021-10-17 19:03:02 +03:00
platform.py [Mellanox] Refactor Mellanox platform API to support dynamic port configuration (#8422) 2021-10-25 07:59:06 +03:00
psu.py Check if PSU files exists when getting psu_voltage properties (#17042) 2024-03-04 19:35:06 +02:00
sfp_event.py [Mellanox] Fix uninitialized variable on module plug event (#17011) 2024-02-05 19:41:16 +02:00
sfp.py [Mellanox] Fix timing issue in lpmode change (#18223) 2024-03-04 16:38:51 +02:00
thermal_manager.py [Mellanox] Fix issues found for CMIS host management (#17637) 2024-01-04 09:42:33 +02:00
thermal_updater.py [Mellanox] Fix issues found for CMIS host management (#17637) 2024-01-04 09:42:33 +02:00
thermal.py Fix error log while creating PSU thermal object (#17789) 2024-01-22 16:22:07 +02:00
utils.py [Mellanox] implement sfp.reset for CMIS management (#16862) 2023-12-17 08:02:47 +02:00
vpd_parser.py [Mellanox] Auto correct PSU voltage threshold (WA) (#10394) 2022-04-14 08:14:40 +03:00
watchdog.py [Mellanox] wait until hw-management watchdog files ready (#17618) 2023-12-26 18:27:18 +02:00