<commit_before>---
version: '2.0'
name: tripleo.scale.v1
description: TripleO Overcloud Deployment Workflows v1

workflows:

  delete_node:
    description: deletes given overcloud nodes and updates the stack

    input:
      - container
      - nodes
      - timeout: 240
      - queue_name: tripleo

    tasks:

      delete_node:
        action: tripleo.scale.delete_node nodes=<% $.nodes %> timeout=<% $.timeout %> container=<% $.container %>
        on-success: wait_for_stack_in_progress
        on-error: set_delete_node_failed last_result=<% task(delete_node).result %>

      wait_for_stack_in_progress:
        workflow: tripleo.stack.v1.wait_for_stack_in_progress stack=<% $.container %>
        on-success: wait_for_stack_complete
        on-error: set_delete_node_failed last_result=<% task(wait_for_stack_in_progress).result %>

      wait_for_stack_complete:
        workflow: tripleo.stack.v1.wait_for_stack_complete_or_failed stack=<% $.container %>
        on-success: send_message
        on-error: set_delete_node_failed last_result=<% task(wait_for_stack_complete).result %>

      set_delete_node_failed:
        input:
          last_result: 'Task failed'
        on-success: send_message
        publish:
          status: FAILED
          message: <% last_result %>

      send_message:
        action: zaqar.queue_post
        retry: count=5 delay=1
        input:
          queue_name: <% $.queue_name %>
          messages:
            body:
              type: tripleo.scale.v1.delete_node
              payload:
                status: <% $.get('status', 'SUCCESS') %>
                message: <% $.get('message', '') %>
                execution: <% execution() %><commit_msg>Fail the scale workflows when sending a "FAILED" message<commit_after>---
version: '2.0'
name: tripleo.scale.v1
description: TripleO Overcloud Deployment Workflows v1

workflows:

  delete_node:
    description: deletes given overcloud nodes and updates the stack

    input:
      - container
      - nodes
      - timeout: 240
      - queue_name: tripleo

    tasks:

      delete_node:
        action: tripleo.scale.delete_node nodes=<% $.nodes %> timeout=<% $.timeout %> container=<% $.container %>
        on-success: wait_for_stack_in_progress
        on-error: set_delete_node_failed last_result=<% task(delete_node).result %>

      wait_for_stack_in_progress:
        workflow: tripleo.stack.v1.wait_for_stack_in_progress stack=<% $.container %>
        on-success: wait_for_stack_complete
        on-error: set_delete_node_failed last_result=<% task(wait_for_stack_in_progress).result %>

      wait_for_stack_complete:
        workflow: tripleo.stack.v1.wait_for_stack_complete_or_failed stack=<% $.container %>
        on-success: send_message
        on-error: set_delete_node_failed last_result=<% task(wait_for_stack_complete).result %>

      set_delete_node_failed:
        input:
          last_result: 'Task failed'
        on-success: send_message
        publish:
          status: FAILED
          message: <% last_result %>

      send_message:
        action: zaqar.queue_post
        retry: count=5 delay=1
        input:
          queue_name: <% $.queue_name %>
          messages:
            body:
              type: tripleo.scale.v1.delete_node
              payload:
                status: <% $.get('status', 'SUCCESS') %>
                message: <% $.get('message', '') %>
                execution: <% execution() %>
        on-success:
          - fail_workflow: <% $.get('status') = "FAILED" %>

      fail_workflow:
        action: std.fail
{'fraction_non_alphanumeric': 0.10652537646402677, 'fraction_numerical': 0.006692693809258227, 'mean_word_length': 2.412940057088487, 'pattern_counts': {'":': 0, '<': 30, '<?xml version=': 0, '>': 30, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1836359', 'n_tokens_mistral': 1126, 'n_tokens_neox': 1055, 'n_words': 215}