diff options
author | Lars Wirzenius <liw@liw.fi> | 2014-03-08 13:11:05 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2014-03-08 14:06:55 +0000 |
commit | 921bda558a15fc6f3e36c1cad9bc1e5db83ce49b (patch) | |
tree | de11e1355b8922ebd022cb9a1c6849741a8e0f97 | |
parent | 00eb5f828716326a35dc5ec72c94c5402acb1ca6 (diff) | |
download | obnam-921bda558a15fc6f3e36c1cad9bc1e5db83ce49b.tar.gz |
Bug fix: Don't fail checksum when chunk not in chunksums
-rw-r--r-- | obnamlib/fmt_6/repo_fmt_6.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/obnamlib/fmt_6/repo_fmt_6.py b/obnamlib/fmt_6/repo_fmt_6.py index 90e04057..39050aa6 100644 --- a/obnamlib/fmt_6/repo_fmt_6.py +++ b/obnamlib/fmt_6/repo_fmt_6.py @@ -818,7 +818,12 @@ class RepositoryFormat6(obnamlib.RepositoryInterface): except obnamlib.RepositoryChunkDoesNotExist: return False actual_checksum = self._checksum(content) - expected_checksum = self._chunklist.get_checksum(chunk_id) + try: + expected_checksum = self._chunklist.get_checksum(chunk_id) + except KeyError: # pragma: no cover + # Chunk is not in the checksum tree, so we cannot valide + # its checksum. We'll just assume it's OK. + return True return actual_checksum == expected_checksum # Individual files in a generation. |