mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-01-26 16:16:31 -06:00
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>
This commit is contained in:
parent
a584758cfb
commit
ab53d80883
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user