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: Ia304170faa6d3a6cec63b8f874101db7559176e5
This commit is contained in:
Vu Cong Tuan 2017-06-20 16:42:31 +07:00
parent 3fb16ee9ae
commit bf22176c70
1 changed files with 3 additions and 2 deletions

View File

@ -13,6 +13,7 @@
# under the License.
import functools
import re
import six
from designateclient import exceptions as designate_exceptions
from django.core.exceptions import ValidationError # noqa
@ -52,8 +53,8 @@ def handle_exc(func):
msg = ""
data = {}
if ex.message is not None:
data['message'] = ex.message
if six.text_type(ex) is not None:
data['message'] = six.text_type(ex)
msg += "Error: %(message)s"
else:
data["type"] = ex.type