]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
Fix wrong arguments to CorruptStoredShareError constructor in immutable share classes.
authorDaira Hopwood <daira@jacaranda.org>
Sun, 14 Jul 2013 15:23:31 +0000 (16:23 +0100)
committerDaira Hopwood <daira@jacaranda.org>
Wed, 9 Apr 2014 00:57:51 +0000 (01:57 +0100)
(Bug pointed out by Mark_B.)

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
src/allmydata/storage/backends/cloud/immutable.py
src/allmydata/storage/backends/disk/immutable.py

index 8091da28d3949386462b92e08148d564c175e5ef..bc3c680709631eae687b7ee3b56fe44cc4daaf5e 100644 (file)
@@ -181,7 +181,7 @@ class ImmutableCloudShareForReading(CloudShareBase, ImmutableCloudShareMixin, Cl
         self._data_length = total_size - self.DATA_OFFSET - (num_leases * self.LEASE_SIZE)
 
         if self._data_length < 0:
-            raise CorruptStoredShareError("calculated data length for shnum %d is %d" % (shnum, self._data_length))
+            raise CorruptStoredShareError(shnum, "calculated data length for shnum %d is %d" % (shnum, self._data_length))
 
     # Boilerplate is in CloudShareBase, read implementation is in CloudShareReaderMixin.
     # So nothing to implement here. Yay!
index bd8af51c42869d2fa459ed71f5ca705c19f1ab49..0363b8fe2d156544095b654198fb3780595e71a8 100644 (file)
@@ -91,7 +91,7 @@ class ImmutableDiskShare(object):
             self._data_length = filesize - self.DATA_OFFSET - (num_leases * self.LEASE_SIZE)
 
         if self._data_length < 0:
-            raise CorruptStoredShareError("calculated data length for shnum %d is %d" % (shnum, self._data_length))
+            raise CorruptStoredShareError(shnum, "calculated data length for shnum %d is %d" % (shnum, self._data_length))
 
     def __repr__(self):
         return ("<ImmutableDiskShare %s:%r at %r>"