From 442e67261fb3c7b5955275d6782ea5c0e6bf44b5 Mon Sep 17 00:00:00 2001 From: deepak-singhal0408 Date: Fri, 21 Jun 2024 20:51:08 +0000 Subject: [PATCH] Ignore sonic_platform package fileNotFoundError on non-chassis vs platforms --- scripts/determine-reboot-cause | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/determine-reboot-cause b/scripts/determine-reboot-cause index a0ddc21a..e8769bb1 100755 --- a/scripts/determine-reboot-cause +++ b/scripts/determine-reboot-cause @@ -108,7 +108,7 @@ def get_reboot_cause_from_platform(): chassis = platform.get_chassis() hardware_reboot_cause_major, hardware_reboot_cause_minor = chassis.get_reboot_cause() sonic_logger.log_info("Platform api returns reboot cause {}, {}".format(hardware_reboot_cause_major, hardware_reboot_cause_minor)) - except ImportError: + except (ImportError, FileNotFoundError): sonic_logger.log_warning("sonic_platform package not installed. Unable to detect hardware reboot causes.") hardware_reboot_cause_major, hardware_reboot_cause_minor = REBOOT_CAUSE_NON_HARDWARE, "N/A"