This is an automated email from the git hooks/post-receive script.
firstyear pushed a commit to branch master
in repository lib389.
commit aa8c84701d7bf698c60e776c4ec1013e2549f623
Author: alisha17 <anejaalisha(a)yahoo.com>
Date: Wed Oct 4 00:30:41 2017 +1100
Ticket 101 - BaseException.message has been deprecated in Python3
Bug Description: Error is caused when some exception is raised in
dsidm file becuase BaseException.message has been deprecated in
Python3
Fix Description: Using str(Exception) fixes the bug for dsidm
as well as all other files using BaseException.message
https://pagure.io/lib389/issue/101
Author: Alisha Aneja
Review by: wibrown (Thanks for your patch!)
---
cli/dscreate | 2 +-
cli/dsctl | 2 +-
cli/dsidm | 2 +-
lib389/cli_base/__init__.py | 2 +-
lib389/tests/krb5_create_test.py | 4 ++--
5 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/cli/dscreate b/cli/dscreate
index 1b1ef7a..4743003 100755
--- a/cli/dscreate
+++ b/cli/dscreate
@@ -70,7 +70,7 @@ By setting this value you acknowledge and take responsibility for the
fact this
result = args.func(inst, log, args)
except Exception as e:
log.debug(e, exc_info=True)
- log.error("Error: %s" % e.message)
+ log.error("Error: %s" % str(e))
if result is True:
log.info('FINISH: Command succeeded')
diff --git a/cli/dsctl b/cli/dsctl
index fed1a96..8aa4f4b 100755
--- a/cli/dsctl
+++ b/cli/dsctl
@@ -85,7 +85,7 @@ if __name__ == '__main__':
result = args.func(inst, log, args)
except Exception as e:
log.debug(e, exc_info=True)
- log.error("Error: %s" % e.message)
+ log.error("Error: %s" % str(e))
disconnect_instance(inst)
if result is True:
diff --git a/cli/dsidm b/cli/dsidm
index 996b71e..1cfc415 100755
--- a/cli/dsidm
+++ b/cli/dsidm
@@ -107,7 +107,7 @@ if __name__ == '__main__':
args.func(inst, dsrc_inst['basedn'], log, args)
except Exception as e:
log.debug(e, exc_info=True)
- log.error("Error: %s" % e.message)
+ log.error("Error: %s" % str(e))
disconnect_instance(inst)
diff --git a/lib389/cli_base/__init__.py b/lib389/cli_base/__init__.py
index 3c34366..21bf3cc 100644
--- a/lib389/cli_base/__init__.py
+++ b/lib389/cli_base/__init__.py
@@ -157,7 +157,7 @@ class LogCapture(logging.Handler):
"""
result = False
for rec in self.outputs:
- if query in rec.message:
+ if query in str(rec):
result = True
return result
diff --git a/lib389/tests/krb5_create_test.py b/lib389/tests/krb5_create_test.py
index ec858e2..182d51f 100644
--- a/lib389/tests/krb5_create_test.py
+++ b/lib389/tests/krb5_create_test.py
@@ -124,7 +124,7 @@ def test_gssapi(topology, add_user):
conn0.sasl_interactive_bind_s('', sasl)
except Exception as e:
print("Exception (expected): %s" % type(e).__name__)
- print('Desc ' + e.message['desc'])
+ print('Desc ' + str(e['desc']))
assert isinstance(e, ldap.INVALID_CREDENTIALS)
# undo
@@ -136,7 +136,7 @@ def test_gssapi(topology, add_user):
conn0.sasl_interactive_bind_s('', sasl)
except Exception as e:
print("Exception (expected): %s" % type(e).__name__)
- print('Desc ' + e.message['desc'])
+ print('Desc ' + str(e['desc']))
assert isinstance(e, ldap.INVALID_CREDENTIALS)
print("SUCCESS")
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.