summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/core
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2017-10-06 11:50:36 +0200
committerKali Kaneko <kali@leap.se>2017-10-06 18:38:42 +0200
commita5cb9c9940b34252da66d43498d705980532f60c (patch)
tree8a4c700c34e09c2faf6f8fe11504cd7c9a8a0350 /src/leap/bitmask/core
parentb66ec16f764be769e4a15dae783292ac4cd32f3b (diff)
[feat] use bonafide Provider object as a singleton
There was common situations where two provider instances where running in parallel. And was creating weird errors (like getting wrong api_uri) because the bootstrap deferreds were global but the Provider objects not. I don't like much singletons, but I think now is simpler than before. - Resolves: #9073
Diffstat (limited to 'src/leap/bitmask/core')
-rw-r--r--src/leap/bitmask/core/mail_services.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/leap/bitmask/core/mail_services.py b/src/leap/bitmask/core/mail_services.py
index 4a5f9798..5337b313 100644
--- a/src/leap/bitmask/core/mail_services.py
+++ b/src/leap/bitmask/core/mail_services.py
@@ -150,7 +150,7 @@ def _get_provider_from_full_userid(userid):
_, provider_id = config.get_username_and_provider(userid)
# TODO -- this autoconf should be passed from the
# command flag. workaround to get cli workinf for now.
- return config.Provider(provider_id, autoconf=True)
+ return config.Provider.get(provider_id, autoconf=True)
def is_service_ready(service, provider):
@@ -337,7 +337,7 @@ class KeymanagerContainer(Container):
return keymanager
def _get_api_uri(self, provider):
- api_uri = config.Provider(provider).api_uri
+ api_uri = config.Provider.get(provider).api_uri
return api_uri
def _get_nicknym_uri(self, provider):