From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 938AA138A1A for ; Mon, 5 Jan 2015 23:12:44 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 27906E0850; Mon, 5 Jan 2015 23:12:41 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 1F378E083E for ; Mon, 5 Jan 2015 23:12:40 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 3F3423406DD for ; Mon, 5 Jan 2015 23:12:39 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 9216FEF3D for ; Mon, 5 Jan 2015 23:12:36 +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: <1420496118.5217031811549514076e29f4e349fdec68042ad3.dolsen@gentoo> Subject: [gentoo-commits] proj/gentoo-keys:master commit in: gkeys/gkeys/ X-VCS-Repository: proj/gentoo-keys X-VCS-Files: gkeys/gkeys/lib.py gkeys/gkeys/seed.py X-VCS-Directories: gkeys/gkeys/ X-VCS-Committer: dolsen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 5217031811549514076e29f4e349fdec68042ad3 X-VCS-Branch: master Date: Mon, 5 Jan 2015 23:12:36 +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: 631132de-5ca2-48ed-8b5a-5dd9b0c75dc2 X-Archives-Hash: 82ac93374b1b7fbd973105bafef5fc90 commit: 5217031811549514076e29f4e349fdec68042ad3 Author: Brian Dolbec gentoo org> AuthorDate: Mon Jan 5 00:52:29 2015 +0000 Commit: Brian Dolbec gentoo org> CommitDate: Mon Jan 5 22:15:18 2015 +0000 URL: http://sources.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=52170318 gkeys/seed.py: Downgrade logger.error msgs to debug if trap_errors is set True Go direct to logger.debug() gkeys/lib.py: Silence error noise for a new key install --- gkeys/gkeys/lib.py | 2 +- gkeys/gkeys/seed.py | 12 +++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/gkeys/gkeys/lib.py b/gkeys/gkeys/lib.py index 6020322..4ae534d 100644 --- a/gkeys/gkeys/lib.py +++ b/gkeys/gkeys/lib.py @@ -134,7 +134,7 @@ class GkeysGPG(GPG): self.logger.debug("LIB: add_key; ensure dirs: " + self.keydir) mode = int(self.config.get_key('permissions', 'directories'),0) ensure_dirs(str(self.keydir), mode=mode) - self.set_keyseedfile(trap_errors=False) + self.set_keyseedfile(trap_errors=True) results = [] for fingerprint in gkey.keys: self.logger.debug("LIB: add_key; adding fingerprint " + fingerprint) diff --git a/gkeys/gkeys/seed.py b/gkeys/gkeys/seed.py index 7d9ae4e..a84003d 100644 --- a/gkeys/gkeys/seed.py +++ b/gkeys/gkeys/seed.py @@ -56,6 +56,8 @@ class Seeds(object): except IOError as err: self.logger.debug("Seed: load; IOError occurred while loading file") if trap_errors: + self.logger.debug("Seed: load; %s" % str(err)) + else: self._error(err) return False for seed in list(seedlines.items()): @@ -216,10 +218,14 @@ class Seeds(object): return False - def _error(self, err): + def _error(self, err, debug=False): '''Class error logging function''' - self.logger.error("Seed: Error processing seed file %s" % self.filename) - self.logger.error("Seed: Error was: %s" % str(err)) + if debug: + self.logger.debug("Seed: Error processing seed file %s" % self.filename) + self.logger.debug("Seed: Error was: %s" % str(err)) + else: + self.logger.error("Seed: Error processing seed file %s" % self.filename) + self.logger.error("Seed: Error was: %s" % str(err)) def _seeds2json(self, seeds):