Disconnect from daemon if getting the info fails

This commit is contained in:
Andrew Resch 2009-12-13 21:34:26 +00:00
commit c312cf4b91

View file

@ -271,16 +271,17 @@ class ConnectionManager(component.Component):
self.__update_buttons() self.__update_buttons()
c.disconnect() c.disconnect()
def on_info_fail(reason): def on_info_fail(reason, c):
if not self.running: if not self.running:
return return
if row: if row:
row[HOSTLIST_COL_STATUS] = _("Offline") row[HOSTLIST_COL_STATUS] = _("Offline")
self.__update_buttons() self.__update_buttons()
c.disconnect()
d = c.daemon.info() d = c.daemon.info()
d.addCallback(on_info, c) d.addCallback(on_info, c)
d.addErrback(on_info_fail) d.addErrback(on_info_fail, c)
def on_connect_failed(reason, host_info): def on_connect_failed(reason, host_info):
if not self.running: if not self.running: