Include the number of remaining shares of the right version in NotEnoughSharesError messages.

Signed-off-by: Daira Hopwood <david-sarah@jacaranda.org>
This commit is contained in:
Daira Hopwood 2013-05-14 17:53:51 +01:00
parent e76281744c
commit 7956e22d21

View File

@ -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)))