From 70ed6378186dca5735f7ff8f51190de7eb7bf3ca Mon Sep 17 00:00:00 2001 From: Derek Higgins Date: Fri, 5 Oct 2018 14:20:22 +0100 Subject: [PATCH] Fail node cleaning on timeout The Use of a retry with continue-on causes the task wait_for_provision_state to finish in success. We need another task to test the provisioning state and conditionally fail based on that. Closes-Bug: #1796293 Change-Id: I94fe438a05c3d20b927f9fe1bc8cc3ea10d85f1e --- workbooks/baremetal.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/workbooks/baremetal.yaml b/workbooks/baremetal.yaml index f3d4e24ee..b2b45a1fd 100644 --- a/workbooks/baremetal.yaml +++ b/workbooks/baremetal.yaml @@ -130,13 +130,21 @@ workflows: message: <% task(set_provision_state).result %> wait_for_provision_state: - on-success: send_message action: ironic.node_get node_id=<% $.node_uuid %> timeout: <% $.timeout %> retry: delay: <% $.retry_delay %> count: <% $.retry_count %> continue-on: <% task().result.provision_state != 'manageable' %> + on-complete: + - send_message: <% task().result.provision_state = 'manageable' %> + - state_not_reached: <% task().result.provision_state != 'manageable' %> + + state_not_reached: + publish: + status: FAILED + message: Cleaning of node <% $.node_uuid %> timed out. + on-complete: send_message send_message: workflow: tripleo.messaging.v1.send