Back to index

obnam  1.1
Public Member Functions | Public Attributes
obnamlib.plugins.fsck_plugin.CheckChunk Class Reference
Inheritance diagram for obnamlib.plugins.fsck_plugin.CheckChunk:
Inheritance graph
[legend]
Collaboration diagram for obnamlib.plugins.fsck_plugin.CheckChunk:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def do

Public Attributes

 chunkid
 checksummer
 name

Detailed Description

Definition at line 36 of file fsck_plugin.py.


Constructor & Destructor Documentation

def obnamlib.plugins.fsck_plugin.CheckChunk.__init__ (   self,
  chunkid,
  checksummer 
)

Definition at line 38 of file fsck_plugin.py.

00038 
00039     def __init__(self, chunkid, checksummer):
00040         self.chunkid = chunkid
00041         self.checksummer = checksummer
00042         self.name = 'chunk %s' % chunkid


Member Function Documentation

Definition at line 43 of file fsck_plugin.py.

00043 
00044     def do(self):
00045         logging.debug('Checking chunk %s' % self.chunkid)
00046         if not self.repo.chunk_exists(self.chunkid):
00047             self.error('chunk %s does not exist' % self.chunkid)
00048         else:
00049             data = self.repo.get_chunk(self.chunkid)
00050             checksum = self.repo.checksum(data)
00051             try:
00052                 correct = self.repo.chunklist.get_checksum(self.chunkid)
00053             except KeyError:
00054                 self.error('chunk %s not in chunklist' % self.chunkid)
00055             else:
00056                 if checksum != correct:
00057                     self.error('chunk %s has wrong checksum' % self.chunkid)
00058 
00059             if self.chunkid not in self.repo.chunksums.find(checksum):
00060                 self.error('chunk %s not in chunksums' % self.chunkid)
00061 
00062             self.checksummer.update(data)
00063         self.chunkids_seen.add(self.chunkid)
00064 

Here is the call graph for this function:


Member Data Documentation

Definition at line 40 of file fsck_plugin.py.

Definition at line 39 of file fsck_plugin.py.

Definition at line 41 of file fsck_plugin.py.


The documentation for this class was generated from the following file: