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 D791B138200 for ; Sun, 23 Jun 2013 07:14:12 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4E18BE0953; Sun, 23 Jun 2013 07:14:02 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E1217E0953 for ; Sun, 23 Jun 2013 07:14:01 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 5DFBB33E6D6 for ; Sun, 23 Jun 2013 07:14:00 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 274BFE546E for ; Sun, 23 Jun 2013 07:13:58 +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: <1371962207.6f9daea91be0a41bf42ce1da065fa7e2d5782235.dol-sen@gentoo> Subject: [gentoo-commits] proj/gentoo-keys:master commit in: gkeyldap/, gkeys/ X-VCS-Repository: proj/gentoo-keys X-VCS-Files: gkeyldap/cli.py gkeys/seed.py X-VCS-Directories: gkeyldap/ gkeys/ X-VCS-Committer: dol-sen X-VCS-Committer-Name: Brian Dolbec X-VCS-Revision: 6f9daea91be0a41bf42ce1da065fa7e2d5782235 X-VCS-Branch: master Date: Sun, 23 Jun 2013 07:13:58 +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: 3e388163-d322-4e8b-a8d3-8f3863aee2af X-Archives-Hash: 6f89b599532ece5860ef92dfb213bcf3 commit: 6f9daea91be0a41bf42ce1da065fa7e2d5782235 Author: Brian Dolbec gentoo org> AuthorDate: Sun Jun 23 01:26:52 2013 +0000 Commit: Brian Dolbec gmail com> CommitDate: Sun Jun 23 04:36:47 2013 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoo-keys.git;a=commit;h=6f9daea9 Strip line feeds from seeds when loading --- gkeyldap/cli.py | 14 ++++++++++---- gkeys/seed.py | 1 + 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/gkeyldap/cli.py b/gkeyldap/cli.py index cd813d4..bf4e00e 100644 --- a/gkeyldap/cli.py +++ b/gkeyldap/cli.py @@ -223,11 +223,18 @@ class Main(object): if not field: continue try: - values = info[field] + # strip errant line feeds + values = [y.strip('\n') for y in info[field]] if values and values in ['uid', 'cn' ]: value = values[0] + # separate out short/long key id's + elif values and x in ['keyid', 'longkeyid']: + value = get_key_ids(x, values) else: value = values + if 'undefined' in values: + logger.error('%s = "undefined" for %s, %s' + %(field, info['uid'][0], info['cn'][0])) if value: keyinfo[x] = value except KeyError: @@ -245,11 +252,10 @@ class Main(object): keyinfo.append(None) continue try: - values = info[field] # strip errant line feeds - values = [x.strip('\n') for x in values] + values = [y.strip('\n') for y in info[field]] if values and field in ['uid', 'cn' ]: - value = values[0].strip('\n') + value = values[0] # separate out short/long key id's elif values and x in ['keyid', 'longkeyid']: value = get_key_ids(x, values) diff --git a/gkeys/seed.py b/gkeys/seed.py index 544ab02..5cfa5fe 100644 --- a/gkeys/seed.py +++ b/gkeys/seed.py @@ -54,6 +54,7 @@ class Seeds(object): for seed in seedlines: try: + seed = seed.strip('\n') parts = self._split_seed(seed, self.separator) self.seeds.append(GKEY._make(parts)) except Exception as err: