]> git.ipfire.org Git - pakfire.git/commitdiff
Warn if the host key is not in the key store.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 24 Jun 2013 21:24:49 +0000 (21:24 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 24 Jun 2013 21:24:49 +0000 (21:24 +0000)
python/pakfire/keyring.py

index 8fe052e9b203f6d0ae00bbafc1a3dd7efc7e6dfa..7bd54fb9fec8a3337e57045b0377397d7678cfc5 100644 (file)
@@ -71,15 +71,17 @@ class Keyring(object):
                os.chmod(filename, 600)
 
        def dump_key(self, keyfp):
-               ret = []
-
                key = self.get_key(keyfp, secret=False)
-               key_priv = self.get_key(keyfp, secret=True)
+               if not key:
+                       return ["  " + _("Not in key store: %s") % keyfp, ""]
 
+               ret = []
                for uid in key.uids:
                        ret.append(uid.uid)
 
                ret.append("  " + _("Fingerprint: %s") % keyfp)
+
+               key_priv = self.get_key(keyfp, secret=True)
                if key_priv:
                        ret.append("    " + _("Private key available!"))
                ret.append("")