control.py: remove all uses of s.get_serverid()
authorBrian Warner <warner@lothar.com>
Sun, 27 Feb 2011 02:12:03 +0000 (19:12 -0700)
committerBrian Warner <warner@lothar.com>
Sun, 27 Feb 2011 02:12:03 +0000 (19:12 -0700)
src/allmydata/control.py
src/allmydata/interfaces.py

index 045a34e5e0354e725e0ad727e043609013189f76..a081e19e957eac492402aaa4362044cdeebbc57e 100644 (file)
@@ -100,23 +100,23 @@ class ControlServer(Referenceable, service.Service):
         if not everyone_left:
             return results
         server = everyone_left.pop(0)
-        peerid = server.get_serverid()
+        server_name = server.longname()
         connection = server.get_rref()
         start = time.time()
         d = connection.callRemote("get_buckets", "\x00"*16)
         def _done(ignored):
             stop = time.time()
             elapsed = stop - start
-            if peerid in results:
-                results[peerid].append(elapsed)
+            if server_name in results:
+                results[server_name].append(elapsed)
             else:
-                results[peerid] = [elapsed]
+                results[server_name] = [elapsed]
         d.addCallback(_done)
         d.addCallback(self._do_one_ping, everyone_left, results)
         def _average(res):
             averaged = {}
-            for peerid,times in results.iteritems():
-                averaged[peerid] = sum(times) / len(times)
+            for server_name,times in results.iteritems():
+                averaged[server_name] = sum(times) / len(times)
             return averaged
         d.addCallback(_average)
         return d
index 85c3e079111b6c8a824a0b07ae9805be9d07ee7d..430981a947e06ced5ca4578d83f01fb1800a2649 100644 (file)
@@ -2321,7 +2321,7 @@ class RIControlClient(RemoteInterface):
         @return: a dictionary mapping peerid to a float (RTT time in seconds)
         """
 
-        return DictOf(Nodeid, float)
+        return DictOf(str, float)
 
 UploadResults = Any() #DictOf(str, str)