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 Jun 7, 2024
1 parent f6bf97e commit 760d798
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 760d798

Please sign in to comment.