[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
This commit is contained in:
tomer-israel 2021-07-19 22:08:44 +03:00 committed by Judy Joseph
parent fe24a4da2b
commit c39ced537e

View File

@ -275,6 +275,9 @@ def get_watchdog():
if device.startswith("watchdog") and is_mlnx_wd_main(device): if device.startswith("watchdog") and is_mlnx_wd_main(device):
watchdog_main_device_name = 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_device_path = "/dev/{}".format(watchdog_main_device_name)
watchdog = None watchdog = None