[Mellanox] Initialize PSU API on both host and docker side (#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 #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
This commit is contained in:
Junchao-Mellanox 2021-04-08 01:36:02 +08:00 committed by GitHub
parent 740dd03138
commit d79a456a62
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,16 +16,14 @@ except ImportError as e:
class Platform(PlatformBase):
def __init__(self):
PlatformBase.__init__(self)
if self._is_host():
self._chassis = Chassis()
self._chassis.initialize_components()
self._chassis.initizalize_system_led()
self._chassis.initialize_eeprom()
else:
self._chassis = Chassis()
self._chassis.initialize_psu()
self._chassis.initialize_fan()
self._chassis.initialize_eeprom()
if self._is_host():
self._chassis.initialize_components()
self._chassis.initizalize_system_led()
else:
self._chassis.initialize_fan()
self._chassis.initialize_thermals()
def _is_host(self):