Skip to content

Commit

Permalink
Addressing review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
rameshraghupathy committed May 31, 2024
1 parent 5389771 commit 5f664ef
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions sonic_platform_base/module_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,20 @@ class ModuleBase(device_base.DeviceBase):
# Device type definition. Note, this is a constant.
DEVICE_TYPE = "module"

# Possible reboot causes
REBOOT_CAUSE_POWER_LOSS = "Power Loss"
REBOOT_CAUSE_THERMAL_OVERLOAD_CPU = "Thermal Overload: CPU"
REBOOT_CAUSE_THERMAL_OVERLOAD_ASIC = "Thermal Overload: ASIC"
REBOOT_CAUSE_THERMAL_OVERLOAD_OTHER = "Thermal Overload: Other"
REBOOT_CAUSE_INSUFFICIENT_FAN_SPEED = "Insufficient Fan Speed"
REBOOT_CAUSE_WATCHDOG = "Watchdog"
REBOOT_CAUSE_HARDWARE_OTHER = "Hardware - Other"
REBOOT_CAUSE_HARDWARE_BIOS = "BIOS"
REBOOT_CAUSE_HARDWARE_CPU = "CPU"
REBOOT_CAUSE_HARDWARE_BUTTON = "Push button"
REBOOT_CAUSE_HARDWARE_RESET_FROM_ASIC = "Reset from ASIC"
REBOOT_CAUSE_NON_HARDWARE = "Non-Hardware"

# Possible card types for modular chassis
MODULE_TYPE_SUPERVISOR = "SUPERVISOR"
MODULE_TYPE_LINE = "LINE-CARD"
Expand Down Expand Up @@ -210,7 +224,7 @@ def get_maximum_consumed_power(self):
# SmartSwitch methods
##############################################

def get_reboot_cause(self):
def get_dpu_id(self):
"""
Retrieves the DPU ID. Returns None for non-smartswitch chassis.
Expand All @@ -231,11 +245,6 @@ def get_reboot_cause(self):
string is "REBOOT_CAUSE_HARDWARE_OTHER", the second string can be
used to pass a description of the reboot cause.
Some more causes are appended to the existing list to handle other
modules such as DPUs.
Ex: REBOOT_CAUSE_POWER_LOSS, REBOOT_CAUSE_HOST_RESET_DPU,
REBOOT_CAUSE_HOST_POWERCYCLED_DPU, REBOOT_CAUSE_SW_THERMAL,
REBOOT_CAUSE_DPU_SELF_REBOOT
"""
raise NotImplementedError

Expand All @@ -256,9 +265,7 @@ def get_health_info(self):
Fetched from the DPUs.
Returns:
An object instance of the dpu health. Should consist of two lists
"summary and monitorlist" See system_health.py for usage
Returns None on switch module
An object instance of the dpu health.
"""
raise NotImplementedError

Expand Down

0 comments on commit 5f664ef

Please sign in to comment.