strip errant line feeds in ldap values
authorBrian Dolbec <dolsen@gentoo.org>
Sun, 23 Jun 2013 01:19:23 +0000 (18:19 -0700)
committerBrian Dolbec <dolsen@gentoo.org>
Sun, 23 Jun 2013 04:30:59 +0000 (21:30 -0700)
gkeyldap/cli.py

index 06da0f3d8c9e51017e874a732b9abb42cb89eed2..052768973c992b8c3f4c0071281f7c6e959332e4 100644 (file)
@@ -245,8 +245,10 @@ class Main(object):
                 continue
             try:
                 values = info[field]
+                # strip errant line feeds
+                values = [x.strip('\n') for x in values]
                 if values and field in ['uid', 'cn' ]:
-                    value = values[0]
+                    value = values[0].strip('\n')
                 # separate out short/long key id's
                 elif values and x in ['keyid', 'longkeyid']:
                     value = get_key_ids(x, values)