binman: Drop algo check in CheckSetHashValue()
authorSimon Glass <sjg@chromium.org>
Thu, 10 Apr 2025 12:43:02 +0000 (06:43 -0600)
committerTom Rini <trini@konsulko.com>
Fri, 11 Apr 2025 20:29:52 +0000 (14:29 -0600)
The CheckAddHashValue() function is always called before this one, so
the algorithm check is never used. Replace it with an assert to avoid a
coverage error.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/binman/state.py

index 6772d36..f4d885c 100644 (file)
@@ -411,8 +411,7 @@ def CheckSetHashValue(node, get_data_func):
             m = hashlib.sha256()
             m.update(get_data_func())
             data = m.digest()
-        if data is None:
-            raise ValueError(f"Node '{node.path}': Unknown hash algorithm '{algo}'")
+        assert data
         for n in GetUpdateNodes(hash_node):
             n.SetData('value', data)