Skip to content

Commit 2e3fb90

Browse files
stephenxssujinmkang
authored andcommitted
[Mellanox]Correct reboot cause when reboot via power cycle (#3597)
* [sonic_platform]remove the handling of reset_sw_reset which indicates rebooted by software. * [sonic_platform]Check "reset_sw_reset" Also check reboot cause file "reset_sw_reset" which indicates the system was rebooted due to software requesting.
1 parent 9032ad8 commit 2e3fb90

File tree

1 file changed

+6
-1
lines changed
  • platform/mellanox/mlnx-platform-api/sonic_platform

1 file changed

+6
-1
lines changed

platform/mellanox/mlnx-platform-api/sonic_platform/chassis.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -319,11 +319,11 @@ def initialize_reboot_cause(self):
319319
'reset_comex_wd' : "Reset requested from ComEx",
320320
'reset_from_asic' : "Reset requested from ASIC",
321321
'reset_reload_bios' : "Reset caused by BIOS reload",
322-
'reset_sw_reset' : "Software reset",
323322
'reset_hotswap_or_halt' : "Reset caused by hotswap or halt",
324323
'reset_from_comex' : "Reset from ComEx",
325324
'reset_voltmon_upgrade_fail': "Reset due to voltage monitor devices upgrade failure"
326325
}
326+
self.reboot_by_software = 'reset_sw_reset'
327327
self.reboot_cause_initialized = True
328328

329329

@@ -350,6 +350,11 @@ def get_reboot_cause(self):
350350
if self._verify_reboot_cause(reset_file):
351351
return self.REBOOT_CAUSE_HARDWARE_OTHER, reset_cause
352352

353+
if self._verify_reboot_cause(self.reboot_by_software):
354+
logger.log_info("Hardware reboot cause: the system was rebooted due to software requesting")
355+
else:
356+
logger.log_info("Hardware reboot cause: no hardware reboot cause found")
357+
353358
return self.REBOOT_CAUSE_NON_HARDWARE, ''
354359

355360

0 commit comments

Comments
 (0)