Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
#!/usr/bin/env python

#############################################################################
# PDDF
# Module contains an implementation of SONiC Platform Base API and
# provides the platform information
# Module contains an implementation of SONiC PDDF Chassis Base API and
# provides the chassis information
#
#############################################################################

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def __init__(self, pddf_data=None, pddf_plugin_data=None):
if not self.is_valid_tlvinfo_header(eeprom):
return

total_length = (ord(eeprom[9]) << 8) | ord(eeprom[10])
total_length = ((eeprom[9]) << 8) | (eeprom[10])
tlv_index = self._TLV_INFO_HDR_LEN
tlv_end = self._TLV_INFO_HDR_LEN + total_length

Expand All @@ -50,21 +50,21 @@ def __init__(self, pddf_data=None, pddf_plugin_data=None):
break

tlv = eeprom[tlv_index:tlv_index + 2
+ ord(eeprom[tlv_index + 1])]
code = "0x%02X" % (ord(tlv[0]))
+ (eeprom[tlv_index + 1])]
code = "0x%02X" % ((tlv[0]))

if ord(tlv[0]) == self._TLV_CODE_VENDOR_EXT:
value = str((ord(tlv[2]) << 24) | (ord(tlv[3]) << 16) |
(ord(tlv[4]) << 8) | ord(tlv[5]))
value += str(tlv[6:6 + ord(tlv[1])])
if (tlv[0]) == self._TLV_CODE_VENDOR_EXT:
value = str(((tlv[2]) << 24) | ((tlv[3]) << 16) |
((tlv[4]) << 8) | (tlv[5]))
value += str(tlv[6:6 + (tlv[1])])
else:
name, value = self.decoder(None, tlv)

self.eeprom_tlv_dict[code] = value
if ord(eeprom[tlv_index]) == self._TLV_CODE_CRC_32:
if (eeprom[tlv_index]) == self._TLV_CODE_CRC_32:
break

tlv_index += ord(eeprom[tlv_index+1]) + 2
tlv_index += (eeprom[tlv_index+1]) + 2

def serial_number_str(self):
(is_valid, results) = self.get_tlv_field(self.eeprom_data, self._TLV_CODE_SERIAL_NUMBER)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
#!/usr/bin/env python

#############################################################################
# PDDF
#
# PDDF fan base class inherited from the base class
#
# All the supported FAN SysFS aattributes are
#- fan<idx>_present
#- fan<idx>_direction
#- fan<idx>_input
#- fan<idx>_pwm
#- fan<idx>_fault
# - fan<idx>_present
# - fan<idx>_direction
# - fan<idx>_input
# - fan<idx>_pwm
# - fan<idx>_fault
# where idx is in the range [1-32]
#
#############################################################################

try:
from sonic_platform_base.fan_base import FanBase
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/usr/bin/env python

#############################################################################
# PDDF
# Module contains an implementation of SONiC Platform API and
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,20 @@
#!/usr/bin/env python
#############################################################################
# PDDF
#
# All the supported PSU SysFS aattributes are
#- psu_present
#- psu_model_name
#- psu_power_good
#- psu_mfr_id
#- psu_serial_num
#- psu_fan_dir
#- psu_v_out
#- psu_i_out
#- psu_p_out
#- psu_fan1_speed_rpm
# PDDF psu base class inherited from the base class
#
# All the supported PSU SysFS aattributes are
# - psu_present
# - psu_model_name
# - psu_power_good
# - psu_mfr_id
# - psu_serial_num
# - psu_fan_dir
# - psu_v_out
# - psu_i_out
# - psu_p_out
# - psu_fan1_speed_rpm
#############################################################################


try:
Expand All @@ -37,7 +40,6 @@ def __init__(self, index, pddf_data=None, pddf_plugin_data=None):
self.platform = self.pddf_obj.get_platform()
self.psu_index = index + 1

self._fan_list = [] # _fan_list under PsuBase class is a global variable, hence we need to use _fan_list per class instatiation
self.num_psu_fans = int(self.pddf_obj.get_num_psu_fans('PSU{}'.format(index+1)))
for psu_fan_idx in range(self.num_psu_fans):
psu_fan = Fan(0, psu_fan_idx, pddf_data, pddf_plugin_data, True, self.psu_index)
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
#!/usr/bin/env python

#############################################################################
# PDDF
#
# PDDF thermal base class inherited from the base class
#
# All the supported Temperature Sensor SysFS aattributes are
#- temp1_high_crit_threshold
#- temp1_high_threshold
#- temp1_input
#- temp_low_threshold
#- temp1_low_crit_threshold
# - temp1_high_crit_threshold
# - temp1_high_threshold
# - temp1_input
# - temp_low_threshold
# - temp1_low_crit_threshold
#############################################################################

try:
from sonic_platform_base.thermal_base import ThermalBase
Expand Down
1 change: 1 addition & 0 deletions rules/docker-platform-monitor.mk
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ $(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(SONIC_CHASSISD_PY3)

ifeq ($(PDDF_SUPPORT),y)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(PDDF_PLATFORM_API_BASE_PY2)
$(DOCKER_PLATFORM_MONITOR)_PYTHON_WHEELS += $(PDDF_PLATFORM_API_BASE_PY3)
endif

$(DOCKER_PLATFORM_MONITOR)_DBG_DEPENDS = $($(DOCKER_CONFIG_ENGINE_BUSTER)_DBG_DEPENDS)
Expand Down