mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-04-07 10:56:49 +00:00
CheckResults.get_servers_responding() now returns IServers
Remove temporary get_new_servers_responding().
This commit is contained in:
parent
957a5315aa
commit
da9ac55294
@ -103,10 +103,8 @@ class CheckResults:
|
||||
return [(s.get_serverid(), SI, shnum)
|
||||
for (s, SI, shnum) in self._list_incompatible_shares]
|
||||
|
||||
def get_new_servers_responding(self):
|
||||
return self._servers_responding
|
||||
def get_servers_responding(self):
|
||||
return [s.get_serverid() for s in self._servers_responding]
|
||||
return self._servers_responding
|
||||
|
||||
def get_host_counter_good_shares(self):
|
||||
return self._count_good_share_hosts
|
||||
|
@ -126,7 +126,7 @@ class CiphertextFileNode:
|
||||
# prr (post-repair results)
|
||||
|
||||
verifycap = self._verifycap
|
||||
servers_responding = set(cr.get_new_servers_responding())
|
||||
servers_responding = set(cr.get_servers_responding())
|
||||
sm = DictOfSets()
|
||||
assert isinstance(cr.get_sharemap(), DictOfSets)
|
||||
for shnum, servers in cr.get_sharemap().items():
|
||||
|
@ -2167,12 +2167,12 @@ class ICheckResults(Interface):
|
||||
(serverid, storage_index, sharenum)."""
|
||||
|
||||
def get_servers_responding():
|
||||
"""Return a list of (binary) storage server identifiers, one for each
|
||||
server which responded to the share query (even if they said they
|
||||
didn't have shares, and even if they said they did have shares but
|
||||
then didn't send them when asked, or dropped the connection, or
|
||||
returned a Failure, and even if they said they did have shares and
|
||||
sent incorrect ones when asked)"""
|
||||
"""Return a list of IServer objects, one for each server which
|
||||
responded to the share query (even if they said they didn't have
|
||||
shares, and even if they said they did have shares but then didn't
|
||||
send them when asked, or dropped the connection, or returned a
|
||||
Failure, and even if they said they did have shares and sent
|
||||
incorrect ones when asked)"""
|
||||
|
||||
def get_host_counter_good_shares():
|
||||
"""Return the number of distinct storage servers with good shares. If
|
||||
|
@ -289,7 +289,8 @@ class DeepCheckWebGood(DeepCheckBase, unittest.TestCase):
|
||||
num_servers, where)
|
||||
self.failUnlessEqual(cr.get_corrupt_shares(), [], where)
|
||||
if not incomplete:
|
||||
self.failUnlessEqual(sorted(cr.get_servers_responding()),
|
||||
self.failUnlessEqual(sorted([s.get_serverid()
|
||||
for s in cr.get_servers_responding()]),
|
||||
sorted(self.g.get_all_serverids()),
|
||||
where)
|
||||
all_serverids = set()
|
||||
|
@ -716,7 +716,9 @@ class Repairer(GridTestMixin, unittest.TestCase, RepairTestMixin,
|
||||
# not respond to the pre-repair filecheck
|
||||
prr = rr.get_post_repair_results()
|
||||
expected = set(self.g.get_all_serverids())
|
||||
self.failUnlessEqual(expected, set(prr.get_servers_responding()))
|
||||
self.failUnlessEqual(expected,
|
||||
set([s.get_serverid()
|
||||
for s in prr.get_servers_responding()]))
|
||||
d.addCallback(_check)
|
||||
return d
|
||||
|
||||
|
@ -18,8 +18,8 @@ def json_check_counts(r):
|
||||
base32.b2a(si), shnum)
|
||||
for (serverid, si, shnum)
|
||||
in r.get_corrupt_shares() ],
|
||||
"servers-responding": [idlib.nodeid_b2a(serverid)
|
||||
for serverid in r.get_servers_responding()],
|
||||
"servers-responding": [s.get_longname()
|
||||
for s in r.get_servers_responding()],
|
||||
"sharemap": dict([(shareid,
|
||||
sorted([s.get_longname() for s in servers]))
|
||||
for (shareid, servers)
|
||||
|
Loading…
x
Reference in New Issue
Block a user