summaryrefslogtreecommitdiff
path: root/heat/tests/test_fault_middleware.py
diff options
context:
space:
mode:
authorClint Byrum <clint@fewbar.com>2013-09-06 20:53:58 -0700
committerClint Byrum <clint@fewbar.com>2013-09-06 20:53:58 -0700
commit9e9c747b4ec0f1972da1d122e46402b00cd0911f (patch)
treee40004db1806db72450e0cd28740c44dcceb9151 /heat/tests/test_fault_middleware.py
parent340dc1bdd2a14ca866e9d45f09a616359bc7521f (diff)
downloadheat-9e9c747b4ec0f1972da1d122e46402b00cd0911f.tar.gz
Only send traceback to users when in debug mode
API services currently send the traceback to clients. While the client hides it from user view, it is still present in the response, exposing the service to details of the engine that administrators likely would not like to have exposed. Fixes bug #1210623 Change-Id: I554ba24b7ac9166e28a8a0a10f566ed9cfa03014
Diffstat (limited to 'heat/tests/test_fault_middleware.py')
-rw-r--r--heat/tests/test_fault_middleware.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/heat/tests/test_fault_middleware.py b/heat/tests/test_fault_middleware.py
index b114b1a5c..9fe55191e 100644
--- a/heat/tests/test_fault_middleware.py
+++ b/heat/tests/test_fault_middleware.py
@@ -27,7 +27,7 @@ class FaultMiddlewareTest(HeatTestCase):
msg = wrapper._error(heat_exc.StackNotFound(stack_name='a'))
expected = {'code': 404,
'error': {'message': 'The Stack (a) could not be found.',
- 'traceback': 'None\n',
+ 'traceback': None,
'type': 'StackNotFound'},
'explanation': 'The resource could not be found.',
'title': 'Not Found'}
@@ -39,7 +39,7 @@ class FaultMiddlewareTest(HeatTestCase):
expected = {'code': 500,
'error': {'message': 'Response from Keystone does '
'not contain a Heat endpoint.',
- 'traceback': 'None\n',
+ 'traceback': None,
'type': 'NoServiceEndpoint'},
'explanation': 'The server has either erred or is '
'incapable of performing the requested '
@@ -48,6 +48,8 @@ class FaultMiddlewareTest(HeatTestCase):
self.assertEqual(msg, expected)
def test_remote_exception(self):
+ # We want tracebacks
+ cfg.CONF.set_override('debug', True)
error = heat_exc.StackNotFound(stack_name='a')
exc_info = (type(error), error, None)
serialized = rpc_common.serialize_remote_exception(exc_info)