From f976bbe697002367ff00a0588a3181fd42008e1c Mon Sep 17 00:00:00 2001 From: jiataotj Date: Fri, 31 May 2013 00:18:28 +0800 Subject: Implement exception module i18n support The doc string in exception.py of Keystone will be returned with __doc__ method, but cannot realize the internationalization.Change exception module to enable i18n support. Changes in the patch are: 1, useing class variable msg_fmt to replace class __doc__ 2, modify wsgi.render_exception function using unicode function to replace str function 3, modify/add UT test cases Fixes: bug # 1179425 Change-Id: I75c1229c905a2625d2f6961d1a8dd3958eac51a5 --- keystone/common/wsgi.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'keystone/common') diff --git a/keystone/common/wsgi.py b/keystone/common/wsgi.py index c7e30576..381f1ff0 100644 --- a/keystone/common/wsgi.py +++ b/keystone/common/wsgi.py @@ -583,7 +583,7 @@ def render_exception(error): body = {'error': { 'code': error.code, 'title': error.title, - 'message': str(error) + 'message': unicode(error) }} if isinstance(error, exception.AuthPluginException): body['error']['identity'] = error.authentication -- cgit