From a14e145ff1eb32951284d43ab484cc578d0faf7a Mon Sep 17 00:00:00 2001 From: Kevin Carter Date: Mon, 17 Feb 2020 18:24:53 -0600 Subject: [PATCH] Remove mistral from the get_deployment_failures deploy workflow This change removes all of mistral from the get_deployment_failures function by calling the required functions directly. Story: 2007212 Task: 38781 Change-Id: I9d6779ff8b85132154541dd11697467aab164f93 Signed-off-by: Kevin Carter --- tripleoclient/workflows/deployment.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/tripleoclient/workflows/deployment.py b/tripleoclient/workflows/deployment.py index 93d6ae262..760cdb28d 100644 --- a/tripleoclient/workflows/deployment.py +++ b/tripleoclient/workflows/deployment.py @@ -604,17 +604,18 @@ def set_deployment_status(clients, plan, status): ) -def get_deployment_failures(clients, **workflow_input): - workflow_client = clients.workflow_engine +def get_deployment_failures(clients, plan): + """Return a list of deployment failures. - result = base.call_action( - workflow_client, - 'tripleo.deployment.get_deployment_failures', - **workflow_input - ) + :param clients: application client object. + :type clients: Object - message = result.get('message') - if message: - print(message) + :param plan: Name of plan to lookup. + :param plan: String - return result['failures'] + :returns: Dictionary + """ + + context = clients.tripleoclient.create_mistral_context() + get_failures = deployment.DeploymentFailuresAction(plan=plan) + return get_failures.run(context=context)['failures']