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

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