diff options
author | Petr Viktorin <pviktori@redhat.com> | 2016-04-29 17:13:08 +0200 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-05-30 16:44:08 +0200 |
commit | 36094b2a542a9472506034dc6c86a573e95c71de (patch) | |
tree | 4c0a466fc5cb49bb4ea36a792e9c5dfca6f6fae4 /ipapython | |
parent | 1ce63e6193701679f539f7c83ddee9f65056b806 (diff) | |
download | freeipa-36094b2a542a9472506034dc6c86a573e95c71de.tar.gz freeipa-36094b2a542a9472506034dc6c86a573e95c71de.tar.xz freeipa-36094b2a542a9472506034dc6c86a573e95c71de.zip |
ipaldap: Keep attribute names as text, not bytes
Part of the work for: https://fedorahosted.org/freeipa/ticket/4985
Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipapython')
-rw-r--r-- | ipapython/ipaldap.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py index 7e920e100..74add512a 100644 --- a/ipapython/ipaldap.py +++ b/ipapython/ipaldap.py @@ -813,7 +813,7 @@ class LDAPClient(object): If there is a problem loading the schema or the attribute is not in the schema return None """ - if isinstance(name_or_oid, unicode): + if six.PY2 and isinstance(name_or_oid, unicode): name_or_oid = name_or_oid.encode('utf-8') if name_or_oid in self._SINGLE_VALUE_OVERRIDE: @@ -1516,7 +1516,7 @@ class LDAPClient(object): # pass arguments to python-ldap with self.error_handler(): - modlist = [(a, self.encode(b), self.encode(c)) + modlist = [(a, str(b), self.encode(c)) for a, b, c in modlist] self.conn.modify_s(str(entry.dn), modlist) |