From e6dc1f081901e8075a75391e50b9fbec0a57e5c0 Mon Sep 17 00:00:00 2001 From: zhurong Date: Thu, 13 Dec 2018 13:43:12 +0800 Subject: [PATCH] python3 ValueError object has no attribute message Change-Id: I09862b245774ab4b26f2ea11dfe4d0cc1d4305b7 --- murano/api/v1/static_actions.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/murano/api/v1/static_actions.py b/murano/api/v1/static_actions.py index d8fe8464d..c86357b72 100644 --- a/murano/api/v1/static_actions.py +++ b/murano/api/v1/static_actions.py @@ -12,6 +12,8 @@ # License for the specific language governing permissions and limitations # under the License. +import six + from oslo_log import log as logging from oslo_messaging.rpc import client from webob import exc @@ -68,8 +70,9 @@ class Controller(object): raise exc.HTTPServiceUnavailable(e.value) except ValueError as e: LOG.error('Exception during call of the method {method_name}: ' - '{exc}'.format(method_name=method_name, exc=str(e))) - raise exc.HTTPBadRequest(e.message) + '{exc}'.format(method_name=method_name, + exc=six.text_type(e))) + raise exc.HTTPBadRequest(six.text_type(e)) def create_resource():