Skip to content

Commit

Permalink
Actions.checkkey: fix success returncode
Browse files Browse the repository at this point in the history
The failed dictionary contains lists for each type of failure,
so return success if all of those lists are emtpy.
  • Loading branch information
zmedico committed Oct 24, 2016
1 parent 423c3bf commit f979e94
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion gkeys/gkeys/actions.py
Expand Up @@ -13,6 +13,7 @@

from __future__ import print_function

import itertools
import os
import sys

Expand Down Expand Up @@ -360,7 +361,7 @@ def checkkey(self, args):
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']),
Expand Down

0 comments on commit f979e94

Please sign in to comment.