From 85722e0410094de1a8053ad95e36faf304d081c2 Mon Sep 17 00:00:00 2001 From: Thomas Herve Date: Tue, 20 Nov 2018 17:50:45 +0100 Subject: [PATCH] Set heatclient exceptions to verbose By setting the verbose flag on the heatclient exception module, we allow the traceback to be included in the error message, which in turns is returned to tripleoclient for the user. Change-Id: I45c54e6591690625c5160517bbbdfec2eb5e5e26 Closes-Bug: #1804268 (cherry picked from commit e22f143cecd02620cbf9efe93f946bbf4c894386) --- tripleo_common/actions/__init__.py | 4 ++++ tripleo_common/tests/actions/test_deployment.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/tripleo_common/actions/__init__.py b/tripleo_common/actions/__init__.py index e69de29bb..f9bbbe07a 100644 --- a/tripleo_common/actions/__init__.py +++ b/tripleo_common/actions/__init__.py @@ -0,0 +1,4 @@ +from heatclient import exc as heat_exc + +# Setup Heat to give us tracebacks on errors. +heat_exc.verbose = 1 diff --git a/tripleo_common/tests/actions/test_deployment.py b/tripleo_common/tests/actions/test_deployment.py index 62c1c6af6..14efa862d 100644 --- a/tripleo_common/tests/actions/test_deployment.py +++ b/tripleo_common/tests/actions/test_deployment.py @@ -402,7 +402,7 @@ class DeployStackActionTest(base.TestCase): action = deployment.DeployStackAction(1, 'overcloud') expected = actions.Result( - error="Error during stack creation: ERROR: Oops") + error="Error during stack creation: ERROR: Oops\n") self.assertEqual(expected, action.run(mock_ctx)) @mock.patch('tripleo_common.actions.deployment.time') @@ -449,7 +449,7 @@ class DeployStackActionTest(base.TestCase): action = deployment.DeployStackAction(1, 'overcloud') expected = actions.Result( - error="Error during stack update: ERROR: Oops") + error="Error during stack update: ERROR: Oops\n") self.assertEqual(expected, action.run(mock_ctx))