summaryrefslogtreecommitdiff
path: root/src/leap/bitmask
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-12-09 11:44:35 +0100
committerRuben Pollan <meskio@sindominio.net>2017-12-09 11:44:35 +0100
commit463e11492e46d7f1205de7b9a9d3250cd4cf988e (patch)
treeb36763cbe63895d57e212d905ececdb66e8853ee /src/leap/bitmask
parent40805b3d9e527368c826a792d15ed334b6f3b8b7 (diff)
[bug] remove stuck_bootstrap deferred from Provider
This deferred was not used anywhere, but it was called twice. Provider is a singleton so multiple logins into the same provider where producing it to be called mor than once. - Resolves: #9171
Diffstat (limited to 'src/leap/bitmask')
-rw-r--r--src/leap/bitmask/bonafide/config.py18
1 files changed, 2 insertions, 16 deletions
diff --git a/src/leap/bitmask/bonafide/config.py b/src/leap/bitmask/bonafide/config.py
index 286ec2ac..222726b7 100644
--- a/src/leap/bitmask/bonafide/config.py
+++ b/src/leap/bitmask/bonafide/config.py
@@ -195,7 +195,6 @@ class Provider(object):
self._provider_config = None
self.first_bootstrap = defer.Deferred()
- self.stuck_bootstrap = None
is_configured = self.is_configured()
if not cert_path and is_configured:
@@ -394,19 +393,13 @@ class Provider(object):
# UNAUTHENTICATED if we try to get the services
# See: # https://leap.se/code/issues/7906
- def further_bootstrap_needs_auth(ignored):
- self.log.warn('Cannot download services config yet, need auth')
- pending_deferred = defer.Deferred()
- self.stuck_bootstrap = pending_deferred
- return defer.succeed('ok for now')
-
uri, met, path = self._get_configs_download_params()
d = httpRequest(
self._http._agent, uri, method=met, saveto=path)
d.addCallback(lambda _: self._load_provider_json())
d.addCallback(
lambda _: self._get_config_for_all_services(session=None))
- d.addErrback(further_bootstrap_needs_auth)
+ d.addErrback(lambda _: 'ok for now')
return d
def download_services_config_with_auth(self, session):
@@ -415,19 +408,12 @@ class Provider(object):
self._load_provider_configs()
return True
- def complete_bootstrapping(ignored):
- if self.stuck_bootstrap:
- d = self._get_config_for_all_services(session)
- d.addCallback(lambda _:
- self.stuck_bootstrap.callback('continue!'))
- return d
-
self._load_provider_json()
uri, met, path = self._get_configs_download_params()
d = session.fetch_provider_configs(uri, path, met)
d.addCallback(verify_provider_configs)
- d.addCallback(complete_bootstrapping)
+ d.addCallback(lambda _: self._get_config_for_all_services(session))
return d
def _get_configs_download_params(self):