summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/services
diff options
context:
space:
mode:
authorIvan Alejandro <ivanalejandro0@gmail.com>2014-02-10 14:29:09 -0300
committerIvan Alejandro <ivanalejandro0@gmail.com>2014-02-11 16:28:43 -0300
commit29902330067f564185d7b57a864be2099f8ea2e8 (patch)
tree761a9bad8b1d7cc5de9bd8526ad7536e378d4a88 /src/leap/bitmask/services
parent706a3cfe7806baed2d382acf8eb7358ef399b924 (diff)
Properly handle defer cancelling.
- Fix issues related to "Cancel login does not work". - Move srpauth errback to mainwindow. - Add signal for provider setup cancel. - Add support to cancel the soledad defer. [Closes #4869] [Closes #4973]
Diffstat (limited to 'src/leap/bitmask/services')
-rw-r--r--src/leap/bitmask/services/abstractbootstrapper.py7
-rw-r--r--src/leap/bitmask/services/soledad/soledadbootstrapper.py2
2 files changed, 8 insertions, 1 deletions
diff --git a/src/leap/bitmask/services/abstractbootstrapper.py b/src/leap/bitmask/services/abstractbootstrapper.py
index 3bee8e01..fc6bd3e9 100644
--- a/src/leap/bitmask/services/abstractbootstrapper.py
+++ b/src/leap/bitmask/services/abstractbootstrapper.py
@@ -28,6 +28,7 @@ from PySide import QtCore
from twisted.python import log
from twisted.internet import threads
+from twisted.internet.defer import CancelledError
from leap.common.check import leap_assert, leap_assert_type
@@ -91,6 +92,12 @@ class AbstractBootstrapper(QtCore.QObject):
:param failure: failure object that Twisted generates
:type failure: twisted.python.failure.Failure
"""
+ if failure.check(CancelledError):
+ logger.debug("Defer cancelled.")
+ failure.trap(Exception)
+ self._signaler.signal(self._signaler.PROV_CANCELLED_SETUP)
+ return
+
if self._signal_to_emit:
err_msg = self._err_msg \
if self._err_msg is not None \
diff --git a/src/leap/bitmask/services/soledad/soledadbootstrapper.py b/src/leap/bitmask/services/soledad/soledadbootstrapper.py
index 9a292b18..53846b31 100644
--- a/src/leap/bitmask/services/soledad/soledadbootstrapper.py
+++ b/src/leap/bitmask/services/soledad/soledadbootstrapper.py
@@ -617,4 +617,4 @@ class SoledadBootstrapper(AbstractBootstrapper):
(self._gen_key, self.gen_key)
]
- self.addCallbackChain(cb_chain)
+ return self.addCallbackChain(cb_chain)