From a5cb9c9940b34252da66d43498d705980532f60c Mon Sep 17 00:00:00 2001 From: Ruben Pollan Date: Fri, 6 Oct 2017 11:50:36 +0200 Subject: [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 --- src/leap/bitmask/core/mail_services.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/leap/bitmask/core') 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): -- cgit v1.2.3