commit: 9fdac1a9270a9d63ef76557c56006abacc45ce28
Author: Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Mon Oct 24 05:45:59 2016 +0000
Commit: Brian Dolbec <dolsen <AT> gentoo <DOT> org>
CommitDate: Fri Dec 23 08:36:24 2016 +0000
URL: https://gitweb.gentoo.org/proj/gentoo-keys.git/commit/?id=9fdac1a9
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.
gkeys/gkeys/actions.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/gkeys/gkeys/actions.py b/gkeys/gkeys/actions.py
index 1533786..8ed126e 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
@@ -437,7 +438,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']),