]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
CheckResults.get_servers_responding() now returns IServers
authorBrian Warner <warner@lothar.com>
Fri, 25 May 2012 19:58:18 +0000 (12:58 -0700)
committerBrian Warner <warner@lothar.com>
Sat, 2 Jun 2012 18:39:12 +0000 (11:39 -0700)
Remove temporary get_new_servers_responding().

src/allmydata/check_results.py
src/allmydata/immutable/filenode.py
src/allmydata/interfaces.py
src/allmydata/test/test_deepcheck.py
src/allmydata/test/test_repairer.py
src/allmydata/web/check_results.py

index e9de13caea037d5ba9baab6ff565055281196291..636603e5105aaa377f72d4482bc6cc17e6cc35a8 100644 (file)
@@ -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
index e248dc9be75602e9cec36dff9c254f6da6dfaddf..a1a0c698849fd801bf0545351a01ee8ea7caa9fd 100644 (file)
@@ -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():
index f4fa2a9d8c6abf2beb5f6b1143db6729ab314743..86c94cd8babdca825f6d20d19cf4062770944e16 100644 (file)
@@ -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
index 2ce8382e5e75eb9603e06774f53bdf0c87e2ae9a..045f5c0e3900e6b6cc952ed19eb16ee249ab7194 100644 (file)
@@ -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()
index 0e007423002561dbe26167827798fe10f6d993e5..0a6eb8c3917c35925465d7b991ebff7c94a2f7c0 100644 (file)
@@ -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
 
index f1f3b3c8bfd641de20abe31ed72c639bcd4b607f..8c2946286bd861fdcf994c3a4fac1f10a59efc24 100644 (file)
@@ -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)