From a09ffad7d24c082744246bccea1788f3423d8ee4 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Sun, 14 Jul 2013 16:23:31 +0100 Subject: [PATCH] Fix wrong arguments to CorruptStoredShareError constructor in immutable share classes. (Bug pointed out by Mark_B.) Signed-off-by: Daira Hopwood --- src/allmydata/storage/backends/cloud/immutable.py | 2 +- src/allmydata/storage/backends/disk/immutable.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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 ("" -- 2.45.2