mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-06-19 15:53:48 +00:00
web: don't break status page when there is no helper running
This commit is contained in:
@ -371,9 +371,15 @@ class Client(node.Node, testutil.PollMixin):
|
|||||||
return watcher.list_recent_retrieve()
|
return watcher.list_recent_retrieve()
|
||||||
|
|
||||||
def list_active_helper_statuses(self):
|
def list_active_helper_statuses(self):
|
||||||
helper = self.getServiceNamed("helper")
|
try:
|
||||||
|
helper = self.getServiceNamed("helper")
|
||||||
|
except KeyError:
|
||||||
|
return []
|
||||||
return helper.get_active_upload_statuses()
|
return helper.get_active_upload_statuses()
|
||||||
def list_recent_helper_statuses(self):
|
def list_recent_helper_statuses(self):
|
||||||
helper = self.getServiceNamed("helper")
|
try:
|
||||||
|
helper = self.getServiceNamed("helper")
|
||||||
|
except KeyError:
|
||||||
|
return []
|
||||||
return helper.get_recent_upload_statuses()
|
return helper.get_recent_upload_statuses()
|
||||||
|
|
||||||
|
@ -1347,8 +1347,13 @@ class SystemTest(testutil.SignalMixin, testutil.PollMixin, unittest.TestCase):
|
|||||||
d.addCallback(_got_helper_status_json)
|
d.addCallback(_got_helper_status_json)
|
||||||
|
|
||||||
# and check that client[3] (which uses a helper but does not run one
|
# and check that client[3] (which uses a helper but does not run one
|
||||||
# itself) doesn't explode when you ask for its helper status with
|
# itself) doesn't explode when you ask for its status
|
||||||
# t=json
|
d.addCallback(lambda res: getPage(self.helper_webish_url + "status/"))
|
||||||
|
def _got_non_helper_status(res):
|
||||||
|
self.failUnless("Upload and Download Status" in res)
|
||||||
|
d.addCallback(_got_non_helper_status)
|
||||||
|
|
||||||
|
# or for helper status with t=json
|
||||||
d.addCallback(lambda res:
|
d.addCallback(lambda res:
|
||||||
getPage(self.helper_webish_url + "helper_status?t=json"))
|
getPage(self.helper_webish_url + "helper_status?t=json"))
|
||||||
def _got_non_helper_status_json(res):
|
def _got_non_helper_status_json(res):
|
||||||
|
Reference in New Issue
Block a user