summaryrefslogtreecommitdiffstats
path: root/ipapython/ipaldap.py
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2017-01-09 19:01:29 +0100
committerMartin Basti <mbasti@redhat.com>2017-01-24 13:25:47 +0100
commitbbe8849a654ed0764e1834f24d1837df41a79881 (patch)
treef4f0441dd319c821ac942d67727ee032e7a98d1a /ipapython/ipaldap.py
parent63b5d4a8594c5c6bc9ade69996fbbc1bcf19a2bf (diff)
downloadfreeipa-bbe8849a654ed0764e1834f24d1837df41a79881.tar.gz
freeipa-bbe8849a654ed0764e1834f24d1837df41a79881.tar.xz
freeipa-bbe8849a654ed0764e1834f24d1837df41a79881.zip
py3: ldap modlist must have keys as string, not bytes
https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Christian Heimes <cheimes@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipapython/ipaldap.py')
-rw-r--r--ipapython/ipaldap.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py
index 3ee40bf71..57f7dc1cb 100644
--- a/ipapython/ipaldap.py
+++ b/ipapython/ipaldap.py
@@ -887,7 +887,8 @@ class LDAPClient(object):
elif isinstance(val, tuple):
return tuple(self.encode(m) for m in val)
elif isinstance(val, dict):
- dct = dict((self.encode(k), self.encode(v)) for k, v in val.items())
+ # key in dict must be str not bytes
+ dct = dict((k, self.encode(v)) for k, v in val.items())
return dct
elif isinstance(val, datetime.datetime):
return val.strftime(LDAP_GENERALIZED_TIME_FORMAT)