diff options
author | Christian Heimes <cheimes@redhat.com> | 2016-11-23 11:01:56 +0100 |
---|---|---|
committer | Martin Basti <mbasti@redhat.com> | 2016-11-25 16:18:22 +0100 |
commit | 7fef9cbec725beed62eb425449083c59416ed975 (patch) | |
tree | 1914842caa626e97396faaf641ec1282f6da2ba7 /ipaserver/plugins | |
parent | 38e8719f728e6d54289507fe2c7f79f9272c45c0 (diff) | |
download | freeipa-7fef9cbec725beed62eb425449083c59416ed975.tar.gz freeipa-7fef9cbec725beed62eb425449083c59416ed975.tar.xz freeipa-7fef9cbec725beed62eb425449083c59416ed975.zip |
Fix Python 3 bugs discovered by pylint
In Python 3 exception instances no longer have a message attribute.
For most exceptions, str(e) or string formatting give the same result.
Fix some renamed modules, module members and functions.
https://fedorahosted.org/freeipa/ticket/4985
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipaserver/plugins')
-rw-r--r-- | ipaserver/plugins/aci.py | 2 | ||||
-rw-r--r-- | ipaserver/plugins/dns.py | 2 |
2 files changed, 2 insertions, 2 deletions
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 |