summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-10-14 15:02:51 +0200
committerJan Cholasta <jcholast@redhat.com>2016-02-17 10:41:29 +0100
commitfe7bd367285618245ce1e203b49418d2ab675dbb (patch)
treedf299da8f3d1e6445b8ae543559b2625a2e1f3a7 /ipaserver
parent831856ea55abb11139114c4c74563a13b6a1b6cf (diff)
downloadfreeipa-fe7bd367285618245ce1e203b49418d2ab675dbb.tar.gz
freeipa-fe7bd367285618245ce1e203b49418d2ab675dbb.tar.xz
freeipa-fe7bd367285618245ce1e203b49418d2ab675dbb.zip
ipaldap, ldapupdate: Encoding fixes for Python 3
https://fedorahosted.org/freeipa/ticket/5638 Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/install/ldapupdate.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/ipaserver/install/ldapupdate.py b/ipaserver/install/ldapupdate.py
index 285251363..95e35f697 100644
--- a/ipaserver/install/ldapupdate.py
+++ b/ipaserver/install/ldapupdate.py
@@ -32,6 +32,7 @@ import pwd
import fnmatch
import ldap
+import six
from ipaserver.install import installutils
from ipapython import ipautil, ipaldap
@@ -44,6 +45,9 @@ from ipapython.dn import DN
from ipapython.ipa_log_manager import log_mgr
from ipapython.ipautil import wait_for_open_socket
+if six.PY3:
+ unicode = str
+
UPDATES_DIR=paths.UPDATES_DIR
UPDATE_SEARCH_TIME_LIMIT = 30 # seconds
@@ -429,6 +433,10 @@ class LDAPUpdate:
"incorrect (%s)" % (v, data_source_name,
lcount, logical_line, e)
)
+ else:
+ for i, v in enumerate(value):
+ if isinstance(v, unicode):
+ value[i] = v.encode('utf-8')
if action != 'replace':
value = value[0]