From: Brian Warner Date: Fri, 1 Dec 2006 01:17:36 +0000 (-0700) Subject: add Client.get_remote_service utility method X-Git-Tag: tahoe_v0.1.0-0-UNSTABLE~527 X-Git-Url: https://git.rkrishnan.org/components/COPYING.GPL?a=commitdiff_plain;h=831ecec0fba1ff283606870d049132dbd5687c0c;p=tahoe-lafs%2Ftahoe-lafs.git add Client.get_remote_service utility method --- diff --git a/allmydata/client.py b/allmydata/client.py index 44f65d56..f52afb73 100644 --- a/allmydata/client.py +++ b/allmydata/client.py @@ -102,3 +102,9 @@ class Client(service.MultiService, Referenceable): log.msg("weird, I didn't have an entry for them") if nodeid in self.connections: del self.connections[nodeid] + + def get_remote_service(self, nodeid, servicename): + if nodeid not in self.connections: + raise IndexError("no connection to that peer") + d = self.connections[nodeid].callRemote("get_service", name=servicename) + return d