Skip to content

Commit

Permalink
[Accton/PDDF] Support show cmd for psu-temp and fan (#10215)
Browse files Browse the repository at this point in the history
Why I did it
Support for show platform temp/fan for psu-temp and fan.
Original code doesn't has fan_drawer to support these information.

How I did it
Support for show platform temp/fan for psu-temp and fan.
Add fan_drawer.py and update thermal.py to add needed code.
It need PDDF common code to support . (Refer to #10213)

How to verify it
Test show platform temp and show platform fan.
root@as7726-32x-2:~# show platform fan
Drawer LED FAN Speed Direction Presence Status Timestamp

Fantray1 green Fantray1_1 38% EXHAUST Present OK 20220311 08:13:04
Fantray1 green Fantray1_2 38% EXHAUST Present OK 20220311 08:13:04
Fantray2 green Fantray2_1 38% EXHAUST Present OK 20220311 08:13:04
Fantray2 green Fantray2_2 38% EXHAUST Present OK 20220311 08:13:04
Fantray3 green Fantray3_1 38% EXHAUST Present OK 20220311 08:13:04
Fantray3 green Fantray3_2 38% EXHAUST Present OK 20220311 08:13:04
Fantray4 green Fantray4_1 38% EXHAUST Present OK 20220311 08:13:04
Fantray4 green Fantray4_2 38% EXHAUST Present OK 20220311 08:13:04
Fantray5 green Fantray5_1 38% EXHAUST Present OK 20220311 08:13:04
Fantray5 green Fantray5_2 38% EXHAUST Present OK 20220311 08:13:04
Fantray6 green Fantray6_1 38% EXHAUST Present OK 20220311 08:13:04
Fantray6 green Fantray6_2 38% EXHAUST Present OK 20220311 08:13:04
N/A green PSU1_FAN1 23% EXHAUST Present OK 20220311 08:13:04
N/A green PSU2_FAN1 22% EXHAUST Present OK 20220311 08:13:04
root@as7726-32x-2:~# show platform temp
Sensor Temperature High TH Low TH Crit High TH Crit Low TH Warning Timestamp

PSU1_TEMP1 28 N/A N/A N/A N/A False 20220311 08:13:04
PSU2_TEMP1 25 N/A N/A N/A N/A False 20220311 08:13:04
TEMP1 23.5 80.0 N/A N/A N/A False 20220311 08:13:04
TEMP2 27 80.0 N/A N/A N/A False 20220311 08:13:04
TEMP3 24 80.0 N/A N/A N/A False 20220311 08:13:04
TEMP4 27 80.0 N/A N/A N/A False 20220311 08:13:04
TEMP5 24 80.0 N/A N/A N/A False 20220311 08:13:04

Co-authored-by: Jostar Yang <jostar_yang@accton.com.tw>
  • Loading branch information
jostar-yang and Jostar Yang authored Mar 29, 2022
1 parent 7debcff commit ab3053b
Show file tree
Hide file tree
Showing 12 changed files with 114 additions and 12 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python


try:
from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer
except ImportError as e:
raise ImportError(str(e) + "- required module not found")


class FanDrawer(PddfFanDrawer):
"""PDDF Platform-Specific Fan-Drawer class"""

def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None):
# idx is 0-based
PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data)

# Provide the functions/variables below for which implementation is to be overwritten
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class Thermal(PddfThermal):
"""PDDF Platform-Specific Thermal class"""

def __init__(self, index, pddf_data=None, pddf_plugin_data=None):
PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data)
def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0):
PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index)

# Provide the functions/variables below for which implementation is to be overwritten
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python


try:
from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer
except ImportError as e:
raise ImportError(str(e) + "- required module not found")


class FanDrawer(PddfFanDrawer):
"""PDDF Platform-Specific Fan-Drawer class"""

def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None):
# idx is 0-based
PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data)

# Provide the functions/variables below for which implementation is to be overwritten
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class Thermal(PddfThermal):
"""PDDF Platform-Specific Thermal class"""

def __init__(self, index, pddf_data=None, pddf_plugin_data=None):
PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data)
def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0):
PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index)

# Provide the functions/variables below for which implementation is to be overwritten
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python


try:
from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer
except ImportError as e:
raise ImportError(str(e) + "- required module not found")


class FanDrawer(PddfFanDrawer):
"""PDDF Platform-Specific Fan-Drawer class"""

def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None):
# idx is 0-based
PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data)

# Provide the functions/variables below for which implementation is to be overwritten
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class Thermal(PddfThermal):
"""PDDF Platform-Specific Thermal class"""

def __init__(self, index, pddf_data=None, pddf_plugin_data=None):
PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data)
def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0):
PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index)

# Provide the functions/variables below for which implementation is to be overwritten
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python


try:
from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer
except ImportError as e:
raise ImportError(str(e) + "- required module not found")


class FanDrawer(PddfFanDrawer):
"""PDDF Platform-Specific Fan-Drawer class"""

def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None):
# idx is 0-based
PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data)

# Provide the functions/variables below for which implementation is to be overwritten
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class Thermal(PddfThermal):
"""PDDF Platform-Specific Thermal class"""

def __init__(self, index, pddf_data=None, pddf_plugin_data=None):
PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data)
def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0):
PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index)

# Provide the functions/variables below for which implementation is to be overwritten
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python


try:
from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer
except ImportError as e:
raise ImportError(str(e) + "- required module not found")


class FanDrawer(PddfFanDrawer):
"""PDDF Platform-Specific Fan-Drawer class"""

def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None):
# idx is 0-based
PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data)

# Provide the functions/variables below for which implementation is to be overwritten
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class Thermal(PddfThermal):
"""PDDF Platform-Specific Thermal class"""

def __init__(self, index, pddf_data=None, pddf_plugin_data=None):
PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data)
def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0):
PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index)

# Provide the functions/variables below for which implementation is to be overwritten
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python


try:
from sonic_platform_pddf_base.pddf_fan_drawer import PddfFanDrawer
except ImportError as e:
raise ImportError(str(e) + "- required module not found")


class FanDrawer(PddfFanDrawer):
"""PDDF Platform-Specific Fan-Drawer class"""

def __init__(self, tray_idx, pddf_data=None, pddf_plugin_data=None):
# idx is 0-based
PddfFanDrawer.__init__(self, tray_idx, pddf_data, pddf_plugin_data)

# Provide the functions/variables below for which implementation is to be overwritten
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class Thermal(PddfThermal):
"""PDDF Platform-Specific Thermal class"""

def __init__(self, index, pddf_data=None, pddf_plugin_data=None):
PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data)
def __init__(self, index, pddf_data=None, pddf_plugin_data=None, is_psu_thermal=False, psu_index=0):
PddfThermal.__init__(self, index, pddf_data, pddf_plugin_data, is_psu_thermal, psu_index)

# Provide the functions/variables below for which implementation is to be overwritten

0 comments on commit ab3053b

Please sign in to comment.