summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins
diff options
context:
space:
mode:
authorJan Cholasta <jcholast@redhat.com>2015-09-11 13:43:28 +0200
committerJan Cholasta <jcholast@redhat.com>2015-09-17 11:08:43 +0200
commit23507e6124041ed17f39db211e802495e37520e7 (patch)
tree8cf010848183a977fde0d5cdcd653556d215cd62 /ipaserver/plugins
parent1550b5ab50966387bac19f46b34a2107010d08d4 (diff)
Alias "unicode" to "str" under Python 3
The six way of doing this is to replace all occurences of "unicode" with "six.text_type". However, "unicode" is non-ambiguous and (arguably) easier to read. Also, using it makes the patches smaller, which should help with backporting. Reviewed-By: Petr Viktorin <pviktori@redhat.com>
Diffstat (limited to 'ipaserver/plugins')
-rw-r--r--ipaserver/plugins/dogtag.py4
-rw-r--r--ipaserver/plugins/join.py5
2 files changed, 9 insertions, 0 deletions
diff --git a/ipaserver/plugins/dogtag.py b/ipaserver/plugins/dogtag.py
index 1b39c148c..1a4bf2eab 100644
--- a/ipaserver/plugins/dogtag.py
+++ b/ipaserver/plugins/dogtag.py
@@ -250,6 +250,7 @@ import pki
from pki.client import PKIConnection
import pki.crypto as cryptoutil
from pki.kra import KRAClient
+import six
from ipalib import Backend
from ipapython.dn import DN
@@ -258,6 +259,9 @@ import ipapython.dogtag
from ipapython import ipautil
from ipaserver.install.certs import CertDB
+if six.PY3:
+ unicode = str
+
# These are general status return values used when
# CMSServlet.outputError() is invoked.
CMS_SUCCESS = 0
diff --git a/ipaserver/plugins/join.py b/ipaserver/plugins/join.py
index 7342117e7..cfa135432 100644
--- a/ipaserver/plugins/join.py
+++ b/ipaserver/plugins/join.py
@@ -21,12 +21,17 @@
Joining an IPA domain
"""
+import six
+
from ipalib import api
from ipalib import Command, Str
from ipalib import errors
from ipalib import _
from ipaserver.install import installutils
+if six.PY3:
+ unicode = str
+
def validate_host(ugettext, cn):
"""