diff --git a/swh/storage/cassandra/storage.py b/swh/storage/cassandra/storage.py --- a/swh/storage/cassandra/storage.py +++ b/swh/storage/cassandra/storage.py @@ -143,11 +143,11 @@ # row continue - for algo in HASH_ALGORITHMS: - if getattr(row, algo) != content.get_hash(algo): + for other_algo in HASH_ALGORITHMS: + if getattr(row, other_algo) != content.get_hash(other_algo): # This hash didn't match; discard the row. collisions.append( - {algo: getattr(row, algo) for algo in HASH_ALGORITHMS} + {k: getattr(row, k) for k in HASH_ALGORITHMS} ) if collisions: diff --git a/swh/storage/tests/test_storage.py b/swh/storage/tests/test_storage.py --- a/swh/storage/tests/test_storage.py +++ b/swh/storage/tests/test_storage.py @@ -296,7 +296,7 @@ exc = cm.value actual_algo = exc.algo - assert actual_algo in ["sha1", "sha1_git", "blake2s256"] + assert actual_algo in ["sha1", "sha1_git"] actual_id = exc.hash_id assert actual_id == getattr(cont1, actual_algo).hex() collisions = exc.args[2]