Skip to content

Commit ae89dc1

Browse files
committed
[module]: Use reboot_gracefully() to record DPU reboot time at command invocation
Signed-off-by: Vasundhara Volam <vvolam@microsoft.com>
1 parent f66ad70 commit ae89dc1

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

utilities_common/module.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,16 @@ def reboot_module(self, module_name, reboot_type):
6161
log.log_error("Unable to get module-index for {}". format(module_name))
6262
return False
6363

64-
if not hasattr(self.platform_chassis.get_module(module_index), 'reboot'):
64+
module = self.platform_chassis.get_module(module_index)
65+
if not hasattr(module, 'reboot'):
6566
log.log_error("Reboot method not found in platform chassis")
6667
return False
6768

6869
log.log_info("Rebooting module {} with reboot_type {}...".format(module_name, reboot_type))
69-
status = self.try_get_args(self.platform_chassis.get_module(module_index).reboot, reboot_type, default=False)
70+
if hasattr(module, 'reboot_gracefully'):
71+
status = self.try_get_args(module.reboot_gracefully, reboot_type, default=False)
72+
else:
73+
status = self.try_get_args(module.reboot, reboot_type, default=False)
7074
if not status:
7175
log.log_error("Reboot status for module {}: {}".format(module_name, status))
7276
return False

0 commit comments

Comments
 (0)