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
This commit is contained in:
Derek Higgins 2018-10-05 14:20:22 +01:00
parent 3e61f4f08c
commit 70ed637818

View File

@ -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