aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2016-10-23 22:45:59 -0700
committerZac Medico <zmedico@gentoo.org>2016-10-23 22:58:34 -0700
commit961f66af2d741386bc917de569153863e086732a (patch)
tree4e22c22ad02ccda162b20b97dbfe22ad01f7fd8d
parentFixed move-seed function (diff)
downloadgentoo-keys-961f66af.tar.gz
gentoo-keys-961f66af.tar.bz2
gentoo-keys-961f66af.zip
Actions.checkkey: fix success returncode
The failed dictionary contains lists for each type of failure, so return success if all of those lists are emtpy.
-rw-r--r--gkeys/gkeys/actions.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py
index 1b27605..d51fb3f 100644
--- a/gkeys/gkeys/actions.py
+++ b/gkeys/gkeys/actions.py
@@ -13,6 +13,7 @@
from __future__ import print_function
+import itertools
import os
import sys
@@ -360,7 +361,7 @@ class Actions(ActionBase):
self.output([failed['invalid']], '\n Invalid keys:\n')
if failed['sign']:
self.output([failed['sign']], '\n No signing capable subkeys:\n')
- return (len(failed) <1,
+ return (not any(itertools.chain.from_iterable(failed.values())),
['\nFound:\n-------', 'Expired: %d' % len(failed['expired']),
'Revoked: %d' % len(failed['revoked']),
'Invalid: %d' % len(failed['invalid']),