From c2fb9b025d727fdbfae27d1f25f58efae1cb7679 Mon Sep 17 00:00:00 2001 From: Dougal Matthews Date: Wed, 11 Jan 2017 14:21:06 +0000 Subject: [PATCH] Fail the scale workflows when sending a "FAILED" message When Mistral workflows execute a second workflow (a sub-workflow execution), the parent workflow can't easily determine if sub-workflow failed. This is because the failure is communicated via a Zaqar message only and when a workflow ends with a successful Zaqar message it appears have been successful. This problem surfaces because parent workflows should have an "on-error" attribute but it is never called, as the workflow doesn't error. This change marks the workflow as failed if the message has the status "FAILED". Now when a sub-workflow fails, the task that called it should have the on-error triggered. Previously it would always go to on-success. Change-Id: I73c5965627e45b8151f67aaf8025369bf6c870bb Related-Bug: #1651704 --- workbooks/scale.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/workbooks/scale.yaml b/workbooks/scale.yaml index e5ae99876..3c8d7dd40 100644 --- a/workbooks/scale.yaml +++ b/workbooks/scale.yaml @@ -51,3 +51,8 @@ workflows: status: <% $.get('status', 'SUCCESS') %> message: <% $.get('message', '') %> execution: <% execution() %> + on-success: + - fail_workflow: <% $.get('status') = "FAILED" %> + + fail_workflow: + action: std.fail