From 9ca3346709b17aef09abb2e34c6b64f51d6e9aae Mon Sep 17 00:00:00 2001 From: Dougal Matthews Date: Mon, 18 Jun 2018 16:55:52 +0100 Subject: [PATCH] Use the standard messaging in the undercloud_backup workbook Update the undercloud_backup workbook to use the standard message sending workflow. This workflow reduces the boilerplate that is copied between workflows by defining the message structure, providing the retry logic and ensuring the task on a "FAILED" message. The workflow also offers optional persistence in Swift. If the plan name is given to the workflow it will store the messages in a Swift container named -messages. Change-Id: I71e761c1295ae0d0ca2773c7521b6a57cabd6227 Related-Bug: #1757372 --- workbooks/undercloud_backup.yaml | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/workbooks/undercloud_backup.yaml b/workbooks/undercloud_backup.yaml index 92e9620ee..120c6ba00 100644 --- a/workbooks/undercloud_backup.yaml +++ b/workbooks/undercloud_backup.yaml @@ -118,16 +118,10 @@ workflows: # Sending a message to show that the backup finished send_message: - action: zaqar.queue_post - retry: count=5 delay=1 + workflow: tripleo.messaging.v1.send input: queue_name: <% $.queue_name %> - messages: - body: - type: tripleo.undercloud_backup.v1.launch - payload: - status: <% $.get('status', 'SUCCESS') %> - execution: <% execution() %> - message: <% $.get('message', '') %> - on-success: - - fail: <% $.get('status') = "FAILED" %> + type: <% execution().name %> + status: <% $.get('status', 'SUCCESS') %> + execution: <% execution() %> + message: <% $.get('message', '') %>