[feat] more verbosity in get_key wrong address log
authorRuben Pollan <meskio@sindominio.net>
Mon, 21 Sep 2015 21:15:33 +0000 (23:15 +0200)
committerRuben Pollan <meskio@sindominio.net>
Mon, 21 Sep 2015 21:15:33 +0000 (23:15 +0200)
src/leap/keymanager/openpgp.py

index 794a0ec..b8b47d0 100644 (file)
@@ -321,7 +321,9 @@ class OpenPGPScheme(EncryptionScheme):
                 raise errors.KeyNotFound(address)
             leap_assert(
                 address in doc.content[KEY_ADDRESS_KEY],
-                'Wrong address in key data.')
+                'Wrong address in key %s. Expected %s, found %s.'
+                % (doc.content[KEY_ID_KEY], address,
+                   doc.content[KEY_ADDRESS_KEY]))
             key = build_key_from_dict(OpenPGPKey, doc.content)
             key._gpgbinary = self._gpgbinary
             return key