From a328fd24c00876d3e473abcea65f86e90610ff43 Mon Sep 17 00:00:00 2001 From: tomer-israel <76040066+tomer-israel@users.noreply.github.com> Date: Mon, 19 Jul 2021 22:08:44 +0300 Subject: [PATCH] [WARM-REBOOT] fix issue of watchdog on simx when executing warm-reboot command (#8132) - Why I did it to prevent python exception error when executing warm-reboot command on mellanox simulator platform - How I did it return None on the watchdog python script on cases that watchdog file is not exist - How to verify it warm-reboot is running well without the python error. error message will appear on log on these cases. in order to avoid this error message we can simulate the watchdog on mellanox simulator platform --- platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py b/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py index 06780627d5..0737b04466 100644 --- a/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py +++ b/platform/mellanox/mlnx-platform-api/sonic_platform/watchdog.py @@ -275,6 +275,9 @@ def get_watchdog(): if device.startswith("watchdog") and is_mlnx_wd_main(device): watchdog_main_device_name = device + if watchdog_main_device_name is None: + return None + watchdog_device_path = "/dev/{}".format(watchdog_main_device_name) watchdog = None