forked from sonic-net/sonic-platform-common
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Combine psu presence/status update with data update (sonic-net#424)
When sysfs is simultaneously changing while psud updating, some data could be outdated immediately once read, so delay the psu presence and status updating to the final step, insure we get the latest info. Description PSU Model Serial HW Rev Voltage (V) Current (A) Power (W) Status LED PSU 1 N/A N/A N/A 12.00 N/A N/A OK green PSU 2 XXXXXXX XXXXXXXX A3 12.01 16.25 194.75 OK green The status should be NOTOK as the psu had been turned off and other fields had became N/A as expected. Motivation and Context The failure flow are showing below: psu_db_update(self.psu_tbl, self.num_psus) // here we read and update the old data of psu status. self.update_psu_data() // now psu status had been changed to NOTOK, but we won’t read it until next psu update cycle , other filed becomes N/A as expected. How Has This Been Tested? platform_tests/api/test_psu.py Signed-off-by: Yuanzhe, Liu <[email protected]>
- Loading branch information
Showing
3 changed files
with
4 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters