From a4a4ba1e4161cf980f863ff97c56e2dcc9f6603e Mon Sep 17 00:00:00 2001 From: Dennis Ahrens <dennis.ahrens@hs-hannover.de> Date: Wed, 6 Aug 2014 14:36:05 +0200 Subject: [PATCH] [TASk] Fixes bug in LDAP extractor. The last commit introduced a bug, that will be fixed with this commit. UnitTests now ran through again. --- hshetl/extractors.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/hshetl/extractors.py b/hshetl/extractors.py index 0a71225..e7be613 100644 --- a/hshetl/extractors.py +++ b/hshetl/extractors.py @@ -205,8 +205,11 @@ class LdapExtractor(AbstractExtractor): row = {'dn': dn} for key, value in entry.items(): logging.debug('%s %s' % (key, value)) - value = map(lambda v: unicode(v.decode(self.connector.encoding)), value) - if len(value) is 1: value = value[0] + if type(value) != list: + value = unicode(value.decode(self.connector.encoding)) + else: + value = map(lambda v: unicode(v.decode(self.connector.encoding)), value) + if len(value) is 1: value = value[0] row[key] = value result.append(row) return result -- GitLab