From 7956e22d2149b0fb7f3014d6f43d01fb520c1b81 Mon Sep 17 00:00:00 2001 From: Daira Hopwood Date: Tue, 14 May 2013 17:53:51 +0100 Subject: [PATCH] Include the number of remaining shares of the right version in NotEnoughSharesError messages. Signed-off-by: Daira Hopwood --- src/allmydata/mutable/retrieve.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/allmydata/mutable/retrieve.py b/src/allmydata/mutable/retrieve.py index fd97b37d..2be92163 100644 --- a/src/allmydata/mutable/retrieve.py +++ b/src/allmydata/mutable/retrieve.py @@ -969,15 +969,18 @@ class Retrieve: """ format = ("ran out of servers: " - "have %(have)d of %(total)d segments " - "found %(bad)d bad shares " + "have %(have)d of %(total)d segments; " + "found %(bad)d bad shares; " + "have %(remaining)d remaining shares of the right version; " "encoding %(k)d-of-%(n)d") args = {"have": self._current_segment, "total": self._num_segments, "need": self._last_segment, "k": self._required_shares, "n": self._total_shares, - "bad": len(self._bad_shares)} + "bad": len(self._bad_shares), + "remaining": len(self.remaining_sharemap), + } raise NotEnoughSharesError("%s, last failure: %s" % (format % args, str(self._last_failure))) -- 2.45.2