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>
This commit is contained in:
Christian Heimes
2016-11-23 11:01:56 +01:00
committed by Martin Basti
parent 38e8719f72
commit 7fef9cbec7
10 changed files with 25 additions and 13 deletions

View File

@@ -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