From c31be3e1bf6e2ea1b081f011664df4313eb7dadf Mon Sep 17 00:00:00 2001 From: drebs Date: Mon, 19 Sep 2016 22:06:43 -0300 Subject: [bug] register keymanager instance as soon as it is created (#8460) --- src/leap/bitmask/core/mail_services.py | 8 ++------ 1 file changed, 2 insertions(+), 6 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 c0c986a..8935bdd 100644 --- a/src/leap/bitmask/core/mail_services.py +++ b/src/leap/bitmask/core/mail_services.py @@ -216,10 +216,10 @@ class KeymanagerContainer(Container): super(KeymanagerContainer, self).__init__(service=service) def add_instance(self, userid, token, uuid, soledad): - + log.msg("Adding Keymanager instance for: %s" % userid) keymanager = self._create_keymanager_instance( userid, token, uuid, soledad) - + super(KeymanagerContainer, self).add_instance(userid, keymanager) d = self._get_or_generate_keys(keymanager, userid) d.addCallback(self._on_keymanager_ready_cb, userid, soledad) return d @@ -228,10 +228,6 @@ class KeymanagerContainer(Container): self.get_instance(userid)._token = token def _on_keymanager_ready_cb(self, keymanager, userid, soledad): - # TODO use onready-deferreds instead - super(KeymanagerContainer, self).add_instance(userid, keymanager) - - log.msg("Adding Keymanager instance for: %s" % userid) data = {'userid': userid, 'soledad': soledad, 'keymanager': keymanager} self.service.trigger_hook('on_new_keymanager_instance', **data) -- cgit v1.2.3