use get_host() in connect()

This commit is contained in:
Damien Churchill 2010-01-29 15:35:51 +00:00
parent 343521ca25
commit caed5accea
1 changed files with 2 additions and 3 deletions

View File

@ -419,9 +419,8 @@ class WebApi(JSONComponent):
d = Deferred()
def on_connected(methods):
d.callback(methods)
for host in self.host_list["hosts"]:
if host_id != host[0]:
continue
host = self.get_host(host_id)
if host:
self._json.connect(*host[1:]).addCallback(on_connected)
return d