From: Daira Hopwood <daira@jacaranda.org>
Date: Sun, 14 Jul 2013 15:23:31 +0000 (+0100)
Subject: Fix wrong arguments to CorruptStoredShareError constructor in immutable share classes.
X-Git-Url: https://git.rkrishnan.org/simplejson/readonly?a=commitdiff_plain;h=751c08bafccf4489b758c5d2985c99b60984d309;p=tahoe-lafs%2Ftahoe-lafs.git

Fix wrong arguments to CorruptStoredShareError constructor in immutable share classes.
(Bug pointed out by Mark_B.)

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
---

diff --git a/src/allmydata/storage/backends/cloud/immutable.py b/src/allmydata/storage/backends/cloud/immutable.py
index 8091da28..bc3c6807 100644
--- a/src/allmydata/storage/backends/cloud/immutable.py
+++ b/src/allmydata/storage/backends/cloud/immutable.py
@@ -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!
diff --git a/src/allmydata/storage/backends/disk/immutable.py b/src/allmydata/storage/backends/disk/immutable.py
index bd8af51c..0363b8fe 100644
--- a/src/allmydata/storage/backends/disk/immutable.py
+++ b/src/allmydata/storage/backends/disk/immutable.py
@@ -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>"