Skip to content

Commit

Permalink
Add check when there are still watchdogs unmatched at the end of dete…
Browse files Browse the repository at this point in the history
…ction
  • Loading branch information
LiaoU3 committed Aug 6, 2024
1 parent fdced8e commit 10601ec
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion providers/base/bin/watchdog_config_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down

0 comments on commit 10601ec

Please sign in to comment.