From: Michael Tremer Date: Mon, 24 Jun 2013 21:24:49 +0000 (+0000) Subject: Warn if the host key is not in the key store. X-Git-Tag: 0.9.26~10^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=60c7a320b14c490487ae4105ccb125a190de828d;p=pakfire.git Warn if the host key is not in the key store. --- diff --git a/python/pakfire/keyring.py b/python/pakfire/keyring.py index 8fe052e9b..7bd54fb9f 100644 --- a/python/pakfire/keyring.py +++ b/python/pakfire/keyring.py @@ -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("")