From: Brian Warner Date: Sun, 27 Feb 2011 02:12:03 +0000 (-0700) Subject: control.py: remove all uses of s.get_serverid() X-Git-Url: https://git.rkrishnan.org/pf?a=commitdiff_plain;h=70f9f89c6647826722d24296157a2e3a891c71e0;p=tahoe-lafs%2Ftahoe-lafs.git control.py: remove all uses of s.get_serverid() --- diff --git a/src/allmydata/control.py b/src/allmydata/control.py index 045a34e5..a081e19e 100644 --- a/src/allmydata/control.py +++ b/src/allmydata/control.py @@ -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 diff --git a/src/allmydata/interfaces.py b/src/allmydata/interfaces.py index 85c3e079..430981a9 100644 --- a/src/allmydata/interfaces.py +++ b/src/allmydata/interfaces.py @@ -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)