summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ipalib/krb_utils.py2
-rw-r--r--ipapython/ipaldap.py5
-rw-r--r--ipaserver/install/dns.py4
-rw-r--r--ipaserver/plugins/aci.py2
-rw-r--r--ipaserver/plugins/dns.py2
-rwxr-xr-xipatests/i18n.py12
-rw-r--r--ipatests/test_integration/env_config.py4
-rw-r--r--ipatests/test_integration/tasks.py3
-rw-r--r--ipatests/test_integration/test_idviews.py2
-rw-r--r--ipatests/test_xmlrpc/test_automount_plugin.py2
10 files changed, 25 insertions, 13 deletions
diff --git a/ipalib/krb_utils.py b/ipalib/krb_utils.py
index e6e277c7a..d005a87b6 100644
--- a/ipalib/krb_utils.py
+++ b/ipalib/krb_utils.py
@@ -161,7 +161,7 @@ def get_credentials(name=None, ccache_name=None):
return gssapi.Credentials(usage='initiate', name=name, store=store)
except gssapi.exceptions.GSSError as e:
if e.min_code == KRB5_FCC_NOFILE: # pylint: disable=no-member
- raise ValueError('"%s", ccache="%s"' % (e.message, ccache_name))
+ raise ValueError('"%s", ccache="%s"' % (e, ccache_name))
raise
def get_principal(ccache_name=None):
diff --git a/ipapython/ipaldap.py b/ipapython/ipaldap.py
index bbfc6f619..94a5e1e0d 100644
--- a/ipapython/ipaldap.py
+++ b/ipapython/ipaldap.py
@@ -27,7 +27,10 @@ import contextlib
import collections
import os
import pwd
-from urlparse import urlparse
+
+# pylint: disable=import-error
+from six.moves.urllib.parse import urlparse
+# pylint: enable=import-error
import ldap
import ldap.sasl
diff --git a/ipaserver/install/dns.py b/ipaserver/install/dns.py
index dd4ab7b7e..842973f2d 100644
--- a/ipaserver/install/dns.py
+++ b/ipaserver/install/dns.py
@@ -132,7 +132,7 @@ def install_check(standalone, api, replica, options, hostname):
if options.force or options.allow_zone_overlap:
root_logger.warning("%s Please make sure that the domain is "
"properly delegated to this IPA server.",
- e.message)
+ e)
else:
raise e
@@ -141,7 +141,7 @@ def install_check(standalone, api, replica, options, hostname):
dnsutil.check_zone_overlap(reverse_zone)
except ValueError as e:
if options.force or options.allow_zone_overlap:
- root_logger.warning(e.message)
+ root_logger.warning(six.text_type(e))
else:
raise e
diff --git a/ipaserver/plugins/aci.py b/ipaserver/plugins/aci.py
index c353715ce..e09a0abad 100644
--- a/ipaserver/plugins/aci.py
+++ b/ipaserver/plugins/aci.py
@@ -354,7 +354,7 @@ def _aci_to_kw(ldap, a, test=False, pkey_only=False):
try:
targetdn = DN(target.replace('ldap:///',''))
except ValueError as e:
- raise errors.ValidationError(name='subtree', error=_("invalid DN (%s)") % e.message)
+ raise errors.ValidationError(name='subtree', error=_("invalid DN (%s)") % e)
if targetdn.endswith(DN(api.env.container_group, api.env.basedn)):
kw['targetgroup'] = targetdn[0]['cn']
else:
diff --git a/ipaserver/plugins/dns.py b/ipaserver/plugins/dns.py
index 3336e9ead..08f9c6dc1 100644
--- a/ipaserver/plugins/dns.py
+++ b/ipaserver/plugins/dns.py
@@ -2149,7 +2149,7 @@ class DNSZoneBase_add(LDAPCreate):
try:
check_zone_overlap(keys[-1], raise_on_error=False)
except ValueError as e:
- raise errors.InvocationError(e.message)
+ raise errors.InvocationError(six.text_type(e))
return dn
diff --git a/ipatests/i18n.py b/ipatests/i18n.py
index aa8932dd6..80f9827f5 100755
--- a/ipatests/i18n.py
+++ b/ipatests/i18n.py
@@ -32,6 +32,8 @@ import traceback
import polib
from collections import namedtuple
+import six
+
'''
We test our translations by taking the original untranslated string
(e.g. msgid) and prepend a prefix character and then append a suffix
@@ -610,8 +612,14 @@ def test_translations(po_file, lang, domain, locale_dir):
t = gettext.translation(domain, locale_dir)
- get_msgstr = t.ugettext
- get_msgstr_plural = t.ungettext
+ if six.PY2:
+ # pylint: disable=no-member
+ get_msgstr = t.ugettext
+ get_msgstr_plural = t.ungettext
+ # pylint: enable=no-member
+ else:
+ get_msgstr = t.gettext
+ get_msgstr_plural = t.ngettext
return po_file_iterate(po_file, get_msgstr, get_msgstr_plural)
diff --git a/ipatests/test_integration/env_config.py b/ipatests/test_integration/env_config.py
index 6e3770fbb..2a137c699 100644
--- a/ipatests/test_integration/env_config.py
+++ b/ipatests/test_integration/env_config.py
@@ -114,8 +114,8 @@ def config_from_env(env):
try:
import yaml
except ImportError as e:
- raise ImportError("%s, please install PyYAML package to fix it" %
- e.message)
+ raise ImportError(
+ "%s, please install PyYAML package to fix it" % e)
with open(env['IPATEST_YAML_CONFIG']) as file:
confdict = yaml.safe_load(file)
return Config.from_dict(confdict)
diff --git a/ipatests/test_integration/tasks.py b/ipatests/test_integration/tasks.py
index c6aab32f0..58b3a6510 100644
--- a/ipatests/test_integration/tasks.py
+++ b/ipatests/test_integration/tasks.py
@@ -1032,7 +1032,8 @@ def install_topo(topo, master, replicas, clients, domain_level=None,
def install_clients(servers, clients):
"""Install IPA clients, distributing them among the given servers"""
- for server, client in itertools.izip(itertools.cycle(servers), clients):
+ izip = getattr(itertools, 'izip', zip)
+ for server, client in izip(itertools.cycle(servers), clients):
log.info('Installing client %s on %s' % (server, client))
install_client(server, client)
diff --git a/ipatests/test_integration/test_idviews.py b/ipatests/test_integration/test_idviews.py
index 9df8c0a46..8a117e0b1 100644
--- a/ipatests/test_integration/test_idviews.py
+++ b/ipatests/test_integration/test_idviews.py
@@ -68,7 +68,7 @@ class TestCertsInIDOverrides(IntegrationTest):
# Initialize NSS database
tasks.run_certutil(master, ["-N", "-f", cls.pwname], cls.reqdir)
# Now generate self-signed certs for a windows user
- stdin_text = string.digits+string.letters[2:] + '\n'
+ stdin_text = string.digits+string.ascii_letters[2:] + '\n'
tasks.run_certutil(master, ['-S', '-s',
"cn=%s,dc=ad,dc=test" % cls.adcert1, '-n',
cls.adcert1, '-x', '-t', 'CT,C,C', '-v',
diff --git a/ipatests/test_xmlrpc/test_automount_plugin.py b/ipatests/test_xmlrpc/test_automount_plugin.py
index e3ad8b49d..aa39b6066 100644
--- a/ipatests/test_xmlrpc/test_automount_plugin.py
+++ b/ipatests/test_xmlrpc/test_automount_plugin.py
@@ -106,7 +106,7 @@ class AutomountTest(XMLRPC_test):
skipped=(),
duplicatemaps=(),
duplicatekeys=(),
- )), res)
+ )), res) # pylint: disable=used-before-assignment
self.check_tofiles()
finally:
res = api.Command['automountlocation_del'](self.locname)['result']