From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id CD25E139085 for ; Fri, 23 Dec 2016 08:37:39 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 2321AE0E2D; Fri, 23 Dec 2016 08:37:34 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 033D0E0E2D for ; Fri, 23 Dec 2016 08:37:29 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CA9643411D7 for ; Fri, 23 Dec 2016 08:37:17 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 786E024F1 for ; Fri, 23 Dec 2016 08:37:14 +0000 (UTC) From: "Brian Dolbec" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Brian Dolbec" Message-ID: <1482482184.9fdac1a9270a9d63ef76557c56006abacc45ce28.dolsen@gentoo> Subject: [gentoo-commits] proj/gentoo-keys:gsoc-2016 commit in: gkeys/gkeys/ X-VCS-Repository: proj/gentoo-keys X-VCS-Files: gkeys/gkeys/actions.py X-VCS-Directories: gkeys/gkeys/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 9fdac1a9270a9d63ef76557c56006abacc45ce28 X-VCS-Branch: gsoc-2016 Date: Fri, 23 Dec 2016 08:37:14 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 09eb219c-ed9b-46ce-b5b2-c30e94b988d6 X-Archives-Hash: 3762d47445d1e1975448a14cfb389cc2 commit: 9fdac1a9270a9d63ef76557c56006abacc45ce28 Author: Zac Medico gentoo org> AuthorDate: Mon Oct 24 05:45:59 2016 +0000 Commit: Brian Dolbec gentoo 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']),