From ae2d4b71d506a226e7268f216bc6b9c3e0168233 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 (cherry picked from commit 70ed6378186dca5735f7ff8f51190de7eb7bf3ca) --- workbooks/baremetal.yaml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/workbooks/baremetal.yaml b/workbooks/baremetal.yaml index 5eeb65e3c..688caa8ca 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: action: zaqar.queue_post