From e22f143cecd02620cbf9efe93f946bbf4c894386 Mon Sep 17 00:00:00 2001 From: Thomas Herve <therve@redhat.com> 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 --- 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 6af6fbc92..35fc39c93 100644 --- a/tripleo_common/tests/actions/test_deployment.py +++ b/tripleo_common/tests/actions/test_deployment.py @@ -404,7 +404,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') @@ -451,7 +451,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)) def test_set_tls_parameters_no_ca_found(self):