summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomás Touceda <chiiph@leap.se>2013-11-13 16:56:38 -0300
committerTomás Touceda <chiiph@leap.se>2013-11-13 16:56:38 -0300
commit836c556149cec70b8d9306e91ea9a39bc905806c (patch)
tree904404e37b5e5e188d8ec97f45568d1858c5e42c
parentff31617ff26293ed7ffcfa5b72d803bc3c766cc7 (diff)
parent223d17f74f59121875d2eb42c3a4e4d638ae2f08 (diff)
Merge remote-tracking branch 'kali/feature/catch_keymanager_error' into develop
-rw-r--r--src/leap/bitmask/services/soledad/soledadbootstrapper.py37
1 files changed, 25 insertions, 12 deletions
diff --git a/src/leap/bitmask/services/soledad/soledadbootstrapper.py b/src/leap/bitmask/services/soledad/soledadbootstrapper.py
index 70318ab8..e8c7e9ce 100644
--- a/src/leap/bitmask/services/soledad/soledadbootstrapper.py
+++ b/src/leap/bitmask/services/soledad/soledadbootstrapper.py
@@ -364,19 +364,32 @@ class SoledadBootstrapper(AbstractBootstrapper):
"""
srp_auth = self.srpauth
logger.debug('initializing keymanager...')
- self._keymanager = KeyManager(
- address,
- "https://nicknym.%s:6425" % (self._provider_config.get_domain(),),
- self._soledad,
- #token=srp_auth.get_token(), # TODO: enable token usage
- session_id=srp_auth.get_session_id(),
- ca_cert_path=self._provider_config.get_ca_cert_path(),
- api_uri=self._provider_config.get_api_uri(),
- api_version=self._provider_config.get_api_version(),
- uid=srp_auth.get_uid(),
- gpgbinary=self._get_gpg_bin_path())
+ try:
+ self._keymanager = KeyManager(
+ address,
+ "https://nicknym.%s:6425" % (
+ self._provider_config.get_domain(),),
+ self._soledad,
+ #token=srp_auth.get_token(), # TODO: enable token usage
+ session_id=srp_auth.get_session_id(),
+ ca_cert_path=self._provider_config.get_ca_cert_path(),
+ api_uri=self._provider_config.get_api_uri(),
+ api_version=self._provider_config.get_api_version(),
+ uid=srp_auth.get_uid(),
+ gpgbinary=self._get_gpg_bin_path())
+ except Exception as exc:
+ logger.exception(exc)
+ raise
+
+ logger.debug('sending key to server...')
+
# make sure key is in server
- self._keymanager.send_key(openpgp.OpenPGPKey)
+ try:
+ self._keymanager.send_key(openpgp.OpenPGPKey)
+ except Exception as exc:
+ logger.error("Error sending key to server.")
+ logger.exception(exc)
+ # but we do not raise
def _gen_key(self, _):
"""