From: Brian Warner Date: Mon, 7 Jul 2008 22:06:15 +0000 (-0700) Subject: servermap.shares_available: report N too, not just k X-Git-Url: https://git.rkrishnan.org/%5B/%5D%20/uri/frontends/COPYING.GPL?a=commitdiff_plain;h=a0de01e97143c36029c5153c19f8faede63d7cff;p=tahoe-lafs%2Ftahoe-lafs.git servermap.shares_available: report N too, not just k --- diff --git a/src/allmydata/mutable/servermap.py b/src/allmydata/mutable/servermap.py index 6fe605ca..37c29b33 100644 --- a/src/allmydata/mutable/servermap.py +++ b/src/allmydata/mutable/servermap.py @@ -186,7 +186,7 @@ class ServerMap: def shares_available(self): """Return a dict that maps verinfo to tuples of - (num_distinct_shares, k) tuples.""" + (num_distinct_shares, k, N) tuples.""" versionmap = self.make_versionmap() all_shares = {} for verinfo, shares in versionmap.items(): @@ -195,7 +195,7 @@ class ServerMap: s.add(shnum) (seqnum, root_hash, IV, segsize, datalength, k, N, prefix, offsets_tuple) = verinfo - all_shares[verinfo] = (len(s), k) + all_shares[verinfo] = (len(s), k, N) return all_shares def highest_seqnum(self): diff --git a/src/allmydata/test/test_mutable.py b/src/allmydata/test/test_mutable.py index e152b828..c431a8be 100644 --- a/src/allmydata/test/test_mutable.py +++ b/src/allmydata/test/test_mutable.py @@ -646,7 +646,7 @@ class Servermap(unittest.TestCase): self.failIfEqual(best, None) self.failUnlessEqual(sm.recoverable_versions(), set([best])) self.failUnlessEqual(len(sm.shares_available()), 1) - self.failUnlessEqual(sm.shares_available()[best], (num_shares, 3)) + self.failUnlessEqual(sm.shares_available()[best], (num_shares, 3, 10)) shnum, peerids = sm.make_sharemap().items()[0] peerid = list(peerids)[0] self.failUnlessEqual(sm.version_on_peer(peerid, shnum), best) @@ -770,7 +770,7 @@ class Servermap(unittest.TestCase): best = sm.best_recoverable_version() self.failUnlessEqual(best, None) self.failUnlessEqual(len(sm.shares_available()), 1) - self.failUnlessEqual(sm.shares_available().values()[0], (2,3) ) + self.failUnlessEqual(sm.shares_available().values()[0], (2,3,10) ) return sm def test_not_quite_enough_shares(self):