Add some logs to be able to follow the key generation.
authorKali Kaneko <kali@futeisha.org>
Fri, 2 Aug 2013 09:16:04 +0000 (11:16 +0200)
committerKali Kaneko <kali@futeisha.org>
Fri, 2 Aug 2013 09:16:04 +0000 (11:16 +0200)
src/leap/keymanager/openpgp.py

index d19bb2b..9d404cb 100644 (file)
@@ -473,7 +473,7 @@ class OpenPGPScheme(EncryptionScheme):
             self.get_key(address)
             raise errors.KeyAlreadyExists(address)
         except errors.KeyNotFound:
-            pass
+            logger.debug('Key for %s not found' % (address,))
 
         def _gen_key(gpg):
             params = gpg.gen_key_input(
@@ -482,9 +482,18 @@ class OpenPGPScheme(EncryptionScheme):
                 name_real=address,
                 name_email=address,
                 name_comment='Generated by LEAP Key Manager.')
+            logger.info("About to generate keys... This might take SOME time.")
             gpg.gen_key(params)
+            logger.info("Keys for %s have been successfully "
+                        "generated." % (address,))
             pubkeys = gpg.list_keys()
+
             # assert for new key characteristics
+
+            # XXX This exception is not properly catched by the soledad
+            # bootstrapping, so if we do not finish generating the keys
+            # we end with a blocked thread -- kali
+
             leap_assert(
                 len(pubkeys) is 1,  # a unitary keyring!
                 'Keyring has wrong number of keys: %d.' % len(pubkeys))