DellEMC: S52xx Reboot cause fix (#10783)

This commit is contained in:
Aravind Mani 2022-05-24 09:33:11 +05:30 committed by GitHub
parent abb977f4c4
commit 9caf12859d
No account linked to committer's email address
2 changed files with 8 additions and 7 deletions

View File

@ -38,7 +38,7 @@ class Chassis(ChassisBase):
oir_fd = -1 oir_fd = -1
epoll = -1 epoll = -1
REBOOT_CAUSE_PATH = "/host/reboot-cause/platform/reboot_reason"
_global_port_pres_dict = {} _global_port_pres_dict = {}
def __init__(self): def __init__(self):
@ -239,15 +239,15 @@ class Chassis(ChassisBase):
return (self.REBOOT_CAUSE_NON_HARDWARE, None) return (self.REBOOT_CAUSE_NON_HARDWARE, None)
if reboot_cause & 0x1: if reboot_cause & 0x1:
return (self.REBOOT_CAUSE_POWER_LOSS, None) return (self.REBOOT_CAUSE_POWER_LOSS, "Power on reset")
elif reboot_cause & 0x2: elif reboot_cause & 0x2:
return (self.REBOOT_CAUSE_NON_HARDWARE, None) return (self.REBOOT_CAUSE_NON_HARDWARE, None)
elif reboot_cause & 0x4: elif reboot_cause & 0x4:
return (self.REBOOT_CAUSE_HARDWARE_OTHER, "PSU Shutdown") return (self.REBOOT_CAUSE_HARDWARE_OTHER, "PSU Shutdown")
elif reboot_cause & 0x8: elif reboot_cause & 0x8:
return (self.REBOOT_CAUSE_THERMAL_OVERLOAD_CPU, None) return (self.REBOOT_CAUSE_THERMAL_OVERLOAD_CPU, "Thermal overload")
elif reboot_cause & 0x10: elif reboot_cause & 0x10:
return (self.REBOOT_CAUSE_WATCHDOG, None) return (self.REBOOT_CAUSE_WATCHDOG, "Watchdog reset")
elif reboot_cause & 0x20: elif reboot_cause & 0x20:
return (self.REBOOT_CAUSE_HARDWARE_OTHER, "BMC Shutdown") return (self.REBOOT_CAUSE_HARDWARE_OTHER, "BMC Shutdown")
elif reboot_cause & 0x40: elif reboot_cause & 0x40:

View File

@ -309,6 +309,7 @@ class Chassis(ChassisBase):
An integer represences the number of SFPs on the chassis. An integer represences the number of SFPs on the chassis.
""" """
return self._num_sfps return self._num_sfps
def get_reboot_cause(self): def get_reboot_cause(self):
""" """
Retrieves the cause of the previous reboot Retrieves the cause of the previous reboot
@ -326,15 +327,15 @@ class Chassis(ChassisBase):
return (self.REBOOT_CAUSE_NON_HARDWARE, None) return (self.REBOOT_CAUSE_NON_HARDWARE, None)
if reboot_cause & 0x1: if reboot_cause & 0x1:
return (self.REBOOT_CAUSE_POWER_LOSS, None) return (self.REBOOT_CAUSE_POWER_LOSS, "Power on reset")
elif reboot_cause & 0x2: elif reboot_cause & 0x2:
return (self.REBOOT_CAUSE_NON_HARDWARE, None) return (self.REBOOT_CAUSE_NON_HARDWARE, None)
elif reboot_cause & 0x4: elif reboot_cause & 0x4:
return (self.REBOOT_CAUSE_HARDWARE_OTHER, "PSU Shutdown") return (self.REBOOT_CAUSE_HARDWARE_OTHER, "PSU Shutdown")
elif reboot_cause & 0x8: elif reboot_cause & 0x8:
return (self.REBOOT_CAUSE_THERMAL_OVERLOAD_CPU, None) return (self.REBOOT_CAUSE_THERMAL_OVERLOAD_CPU, "Thermal overload")
elif reboot_cause & 0x10: elif reboot_cause & 0x10:
return (self.REBOOT_CAUSE_WATCHDOG, None) return (self.REBOOT_CAUSE_WATCHDOG, "Watchdog reset")
elif reboot_cause & 0x20: elif reboot_cause & 0x20:
return (self.REBOOT_CAUSE_HARDWARE_OTHER, "BMC Shutdown") return (self.REBOOT_CAUSE_HARDWARE_OTHER, "BMC Shutdown")
elif reboot_cause & 0x40: elif reboot_cause & 0x40: