Stop using deprecated 'message' attribute in Exception
The 'message' attribute has been deprecated and removed from Python3. For more details, please check: https://www.python.org/dev/peps/pep-0352/ Change-Id: I6b5596d2376a4013754471ce834e2ac651e377ba
This commit is contained in:
@@ -275,10 +275,10 @@ class QueryParamsSchemaTestCase(test.NoDBTestCase):
|
||||
req)
|
||||
if six.PY3:
|
||||
self.assertEqual("Invalid input for query parameters foo. Value: "
|
||||
"abc. 'abc' is not a 'uuid'", ex.message)
|
||||
"abc. 'abc' is not a 'uuid'", six.text_type(ex))
|
||||
else:
|
||||
self.assertEqual("Invalid input for query parameters foo. Value: "
|
||||
"abc. u'abc' is not a 'uuid'", ex.message)
|
||||
"abc. u'abc' is not a 'uuid'", six.text_type(ex))
|
||||
|
||||
def test_validate_request_with_multiple_values(self):
|
||||
req = fakes.HTTPRequest.blank("/tests?foos=abc")
|
||||
|
@@ -18,6 +18,7 @@ from cinderclient import exceptions as cinder_exception
|
||||
from keystoneclient import exceptions as keystone_exception
|
||||
import mock
|
||||
from oslo_utils import timeutils
|
||||
import six
|
||||
|
||||
import nova.conf
|
||||
from nova import context
|
||||
@@ -412,7 +413,7 @@ class CinderApiTestCase(test.NoDBTestCase):
|
||||
attachment_id)
|
||||
|
||||
self.assertEqual(404, ex.code)
|
||||
self.assertIn(attachment_id, ex.message)
|
||||
self.assertIn(attachment_id, six.text_type(ex))
|
||||
|
||||
@mock.patch('nova.volume.cinder.cinderclient',
|
||||
side_effect=exception.CinderAPIVersionNotAvailable(
|
||||
|
Reference in New Issue
Block a user