From 760d798a83f972c5e40b9a4caf1ccb8ede90279e Mon Sep 17 00:00:00 2001 From: liaou3 Date: Fri, 7 Jun 2024 15:40:47 +0800 Subject: [PATCH] Add check when there are still watchdogs unmatched at the end of detection --- providers/base/bin/watchdog_config_test.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/providers/base/bin/watchdog_config_test.py b/providers/base/bin/watchdog_config_test.py index 8ace07517e..8795fd0038 100755 --- a/providers/base/bin/watchdog_config_test.py +++ b/providers/base/bin/watchdog_config_test.py @@ -214,7 +214,6 @@ def detect() -> None: path = "/sys/class/watchdog/{}/identity".format(watchdog) with open(path, "r") as f: identity = f.readline().strip() - print("Identity of {}: {}".format(path, identity)) try: # check that the identity was expected input_identities.remove(identity) @@ -228,6 +227,13 @@ def detect() -> None: os.environ["WATCHDOG_IDENTITY"], identity ) ) + # Check if there are any remain watchdogs + if input_identities: + raise SystemExit( + "There are still unmatched watchdogs!\n{}".format( + input_identities + ) + ) # Handle unrecognized image source else: