summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKali Kaneko <kali@leap.se>2013-10-01 12:36:20 -0400
committerKali Kaneko <kali@leap.se>2013-10-01 12:36:20 -0400
commit010c2119c787b61301dbc9b9ec4e654edd33086e (patch)
tree963572b9d3c19484a9f28ef3d38f2e089346eab7 /src
parent0fa4712d10936329aa5012b3173bdd0fc0362e9f (diff)
Add more verbose error handling
To help diagnose this problem. I think we might prefer to leave this on hold until we merge the new gnupg module.
Diffstat (limited to 'src')
-rw-r--r--src/leap/bitmask/services/soledad/soledadbootstrapper.py18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/leap/bitmask/services/soledad/soledadbootstrapper.py b/src/leap/bitmask/services/soledad/soledadbootstrapper.py
index d348661d..6731cc84 100644
--- a/src/leap/bitmask/services/soledad/soledadbootstrapper.py
+++ b/src/leap/bitmask/services/soledad/soledadbootstrapper.py
@@ -362,11 +362,27 @@ class SoledadBootstrapper(AbstractBootstrapper):
try:
self._keymanager.get_key(
address, openpgp.OpenPGPKey, private=True, fetch_remote=False)
+ return
except KeyNotFound:
logger.debug("Key not found. Generating key for %s" % (address,))
+
+ # generate key
+ try:
self._keymanager.gen_key(openpgp.OpenPGPKey)
+ except Exception as exc:
+ logger.error("error while generating key!")
+ logger.exception(exc)
+ raise
+
+ # send key
+ try:
self._keymanager.send_key(openpgp.OpenPGPKey)
- logger.debug("Key generated successfully.")
+ except Exception as exc:
+ logger.error("error while sending key!")
+ logger.exception(exc)
+ raise
+
+ logger.debug("Key generated successfully.")
def run_soledad_setup_checks(self,
provider_config,