Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 597940

Summary: app-crypt/gkeys-0.2: gkeys check-key always exits unsuccessfully
Product: Gentoo Hosted Projects Reporter: Zac Medico <zmedico>
Component: gentoo-keysAssignee: Gentoo-keys project <gkeys>
Status: RESOLVED OBSOLETE    
Severity: normal CC: treecleaner
Priority: Normal Keywords: InVCS, PATCH, PMASKED
Version: unspecified   
Hardware: All   
OS: All   
URL: https://github.com/gentoo/gentoo-keys/pull/53
Whiteboard:
Package list:
Runtime testing required: ---
Deadline: 2020-05-19   

Description Zac Medico gentoo-dev 2016-10-24 06:00:08 UTC
From: Zac Medico <zmedico@gentoo.org>
Date: Sun, 23 Oct 2016 22:45:59 -0700
Subject: [PATCH] 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 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']),
--
Comment 1 Brian Dolbec (RETIRED) gentoo-dev 2016-10-27 20:04:01 UTC
applied, thank you :)
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-04-19 12:12:30 UTC
app-crypt/gkeys is last rited now.
Comment 3 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-05-23 09:31:22 UTC
Removing.