summaryrefslogtreecommitdiffstats
path: root/ipapython
diff options
context:
space:
mode:
authorMartin Basti <mbasti@redhat.com>2017-02-06 18:42:08 +0100
committerJan Cholasta <jcholast@redhat.com>2017-02-08 08:32:44 +0100
commitab53d80883320060769b7bfada2a813b345b9e4a (patch)
treec00454e5ce0300d487813fa19d36f583c917b835 /ipapython
parenta584758cfb87567a9c640ae107903b0f6c9fec30 (diff)
downloadfreeipa-ab53d80883320060769b7bfada2a813b345b9e4a.tar.gz
freeipa-ab53d80883320060769b7bfada2a813b345b9e4a.tar.xz
freeipa-ab53d80883320060769b7bfada2a813b345b9e4a.zip
py3: ipaldap: properly encode DNSName to bytes
The encode method of LDAPClient didn't return DNSName as bytes but string in py3. In py2 it returns non-unicode string so it can be encoded safely by ascii as to_text() method returns only ascii characters. https://fedorahosted.org/freeipa/ticket/4985 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipapython')
-rw-r--r--ipapython/ipaldap.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py
index 497b94754..37d23d731 100644
--- a/ipapython/ipaldap.py
+++ b/ipapython/ipaldap.py
@@ -849,7 +849,7 @@ class LDAPClient(object):
Principal)):
return six.text_type(val).encode('utf-8')
elif isinstance(val, DNSName):
- return val.to_text()
+ return val.to_text().encode('ascii')
elif isinstance(val, bytes):
return val
elif isinstance(val, list):