Replaced e.message with str(e)

For logging the exception message: e.message has been
deprecated. The preferred way is to call str(e).
more details:
https://www.python.org/dev/peps/pep-0352/

Change-Id: Ic22fbd37376843f714d2c1669d2cdc25a3569225
This commit is contained in:
gecong1973 2016-11-17 16:01:34 +08:00 committed by gecong
parent d26d358145
commit 3f7cc06aff
2 changed files with 2 additions and 2 deletions
tackerclient/tests/unit

@ -711,7 +711,7 @@ class CLITestV10ExceptionHandler(CLITestV10Base):
expected_msg = '\n'.join([error_msg, error_detail])
else:
expected_msg = error_msg
self.assertEqual(expected_msg, e.message)
self.assertEqual(expected_msg, str(e))
def test_exception_handler_v10_ip_address_in_use(self):
err_msg = ('Unable to complete operation for network '

@ -70,7 +70,7 @@ class TestHTTPClient(testtools.TestCase):
e = self.assertRaises(exceptions.Unauthorized,
self.http._cs_request, URL, METHOD)
self.assertEqual('unauthorized message', e.message)
self.assertEqual('unauthorized message', str(e))
self.mox.VerifyAll()
def test_request_forbidden_is_returned_to_caller(self):