deluge: Fix set default daemon

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
This commit is contained in:
Veiko Aasa authored and James Valleroy committed 2020-01-12 15:55:52 -05:00
1 parent ff27f1d21b
commit 721e09fee9
2 files changed
+50 -9

No files matched your search

+12
View File
@@ -320,8 +320,20 @@ def _deluge_get_active_window_title(browser):
def _deluge_ensure_logged_in(browser):
"""Ensure that password dialog is answered and we can interact."""
url = config['DEFAULT']['url'] + '/deluge'
def service_is_available():
if browser.is_element_present_by_xpath(
'//h1[text()="Service Unavailable"]'):
access_url(browser, 'deluge')
return False
return True
if browser.url != url:
browser.visit(url)
# After a backup restore, service may not be available immediately
eventually(service_is_available)
time.sleep(1) # Wait for Ext.js application in initialize
if _deluge_get_active_window_title(browser) != 'Login':