Skip to content

Commit 0dcc7fe

Browse files
committed
remove the empty bracket if no hardware reboot cause minor
1 parent e47d831 commit 0dcc7fe

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

scripts/determine-reboot-cause

+6-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,12 @@ def find_hardware_reboot_cause():
122122
else:
123123
sonic_logger.log_info("No reboot cause found from platform api")
124124

125-
hardware_reboot_cause = "{} ({})".format(hardware_reboot_cause_major, hardware_reboot_cause_minor)
125+
hardware_reboot_cause_minor_str = ""
126+
if hardware_reboot_cause_minor:
127+
hardware_reboot_cause_minor_str = " ({})".format(hardware_reboot_cause_minor)
128+
129+
hardware_reboot_cause = hardware_reboot_cause_major + hardware_reboot_cause_minor_str
130+
126131
return hardware_reboot_cause
127132

128133

0 commit comments

Comments
 (0)