Skip to content

Commit

Permalink
[Mellanox] Initialize PSU API on both host and docker side (sonic-net…
Browse files Browse the repository at this point in the history
…#7075)

- Why I did it
There was a change to replace platform utils with sonic platform API in psuutil. However, psu API is not initialized on host side. The PR is to fix it.
Backport of sonic-net#7016 to the 202012 branch.

- How I did it
Initialize PSU API on both host and non-host side

- How to verify it
Manual test
  • Loading branch information
Junchao-Mellanox authored Apr 7, 2021
1 parent 740dd03 commit d79a456
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions platform/mellanox/mlnx-platform-api/sonic_platform/platform.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,14 @@
class Platform(PlatformBase):
def __init__(self):
PlatformBase.__init__(self)
if self._is_host():
self._chassis = Chassis()
self._chassis = Chassis()
self._chassis.initialize_psu()
self._chassis.initialize_eeprom()
if self._is_host():
self._chassis.initialize_components()
self._chassis.initizalize_system_led()
self._chassis.initialize_eeprom()
else:
self._chassis = Chassis()
self._chassis.initialize_psu()
self._chassis.initizalize_system_led()
else:
self._chassis.initialize_fan()
self._chassis.initialize_eeprom()
self._chassis.initialize_thermals()

def _is_host(self):
Expand Down

0 comments on commit d79a456

Please sign in to comment.