From dee7655526699e3f66bf3744e098f03203345449 Mon Sep 17 00:00:00 2001 From: "Marty Y. Lok" <76118573+mlok-nokia@users.noreply.github.com> Date: Wed, 11 May 2022 13:07:04 -0400 Subject: [PATCH] [reboiot-cause] Fix a broken symlink of previous-reboot-cause file removal issue (#10751) Signed-off-by: mlok --- src/sonic-host-services/scripts/determine-reboot-cause | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sonic-host-services/scripts/determine-reboot-cause b/src/sonic-host-services/scripts/determine-reboot-cause index 1408ad0e29..21b13d86aa 100755 --- a/src/sonic-host-services/scripts/determine-reboot-cause +++ b/src/sonic-host-services/scripts/determine-reboot-cause @@ -174,7 +174,7 @@ def main(): os.makedirs(REBOOT_CAUSE_DIR) # Remove stale PREVIOUS_REBOOT_CAUSE_FILE if it exists - if os.path.exists(PREVIOUS_REBOOT_CAUSE_FILE): + if os.path.exists(PREVIOUS_REBOOT_CAUSE_FILE) or os.path.islink(PREVIOUS_REBOOT_CAUSE_FILE): os.remove(PREVIOUS_REBOOT_CAUSE_FILE) # This variable is kept for future-use purpose. When proc_cmd_line/vendor/software provides