sonic-buildimage/device/nokia/armhf-nokia_ixs7215_52x-r0/plugins/psuutil.py
carl-nokia 0a9d7a2145
[devices]: Add support for the Nokia-7215 platform (#5827)
Platform: armhf-nokia_ixs7215_52x-r0
HwSKU: Nokia-7215
ASIC: marvell
Port Config: 48x1G + 4x10G

Co-authored-by: dflynn <dennis.flynn@nokia.com>
Co-authored-by: Carl Keene <keene@nokia.com>
2020-11-18 17:00:40 -08:00

33 lines
930 B
Python
Executable File

try:
import sonic_platform.platform
import sonic_platform.chassis
from sonic_psu.psu_base import PsuBase
except ImportError as e:
raise ImportError(str(e) + "- required module not found")
class PsuUtil(PsuBase):
"""Platform-specific PSUutil class"""
def __init__(self):
PsuBase.__init__(self)
self.chassis = sonic_platform.platform.Platform().get_chassis()
def get_num_psus(self):
MAX_PSUS = 2
return MAX_PSUS
def get_psu_status(self, index):
# print " psuUtil redirect to PMON 2.0 "
if self.chassis is not None:
return self.chassis.get_psu(index-1).get_status()
else:
return False
def get_psu_presence(self, index):
# print " psuUtil redirect to PMON 2.0 "
if self.chassis is not None:
return self.chassis.get_psu(index-1).get_presence()
else:
return False