summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2013-12-24 23:36:10 +0000
committerLars Wirzenius <liw@liw.fi>2013-12-28 21:51:25 +0000
commit3a55724a28e80dc60288f37f0627141227fad5f5 (patch)
treef861aea23f0bd4d4c45598b5d0013cfff867a99d
parentbae70f9b6085630f278555d20beb52d387bca651 (diff)
downloadobnam-3a55724a28e80dc60288f37f0627141227fad5f5.tar.gz
Use validate_chunk_content in fsck
-rw-r--r--obnamlib/plugins/fsck_plugin.py20
-rw-r--r--test-gpghome/random_seedbin600 -> 600 bytes
2 files changed, 4 insertions, 16 deletions
diff --git a/obnamlib/plugins/fsck_plugin.py b/obnamlib/plugins/fsck_plugin.py
index 71a9513f..8843541e 100644
--- a/obnamlib/plugins/fsck_plugin.py
+++ b/obnamlib/plugins/fsck_plugin.py
@@ -48,24 +48,12 @@ class CheckChunk(WorkItem):
self.error('chunk %s does not exist' % self.chunkid)
else:
data = self.repo.get_chunk_content(self.chunkid)
+ self.checksummer.update(data)
- # FIXME: We should be checking the the chunk's checksum here,
- # but this is not possible using the new RepositoryInterface
- # API, which intentionally hides implementation details that
- # may be different in different implementations.
- # checksum = hashlib.md5(data).hexdigest()
- # try:
- # correct = self.repo.chunklist.get_checksum(self.chunkid)
- # except KeyError:
- # self.error('chunk %s not in chunklist' % self.chunkid)
- # else:
- # if checksum != correct:
- # self.error('chunk %s has wrong checksum' % self.chunkid)
-
- # if self.chunkid not in self.repo.chunksums.find(checksum):
- # self.error('chunk %s not in chunksums' % self.chunkid)
+ valid = self.repo.validate_chunk_content(self.chunkid)
+ if valid is False:
+ self.error('chunk %s is corrupted' % self.chunkid)
- self.checksummer.update(data)
self.chunkids_seen.add(self.chunkid)
diff --git a/test-gpghome/random_seed b/test-gpghome/random_seed
index 3a3a9272..2beb79eb 100644
--- a/test-gpghome/random_seed
+++ b/test-gpghome/random_seed
Binary files differ