From 2cd1fbd87bfde7ec318356178d1ca4c68859e916 Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Thu, 20 Jan 2022 10:42:04 +0900 Subject: [PATCH] Fix reference to undefined variables when heat-config times out When an async task times out, it doesn't register its result and the subsequent task which refers to the result can't look up details like stderr output or return code. This change defines the default values to fix reference to unefined variables. Closes-Bug: #1958471 Change-Id: I5049e88872bfe3aa8072804cb67e8f7178951d9d --- tripleo_common/templates/deployments.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tripleo_common/templates/deployments.yaml b/tripleo_common/templates/deployments.yaml index fa56ad822..350a69d6a 100644 --- a/tripleo_common/templates/deployments.yaml +++ b/tripleo_common/templates/deployments.yaml @@ -200,11 +200,11 @@ - name: "Output for async deployment {{ item }}" debug: msg: - - stderr: "{{ deployment_async_result.stderr.split('\n') }}" - - status_code: "{{ deployment_async_result.rc }}" + - stderr: "{{ deployment_async_result.stderr_lines | default(['Timed out']) }}" + - status_code: "{{ deployment_async_result.rc | default(-1) }}" tags: - output - failed_when: deployment_async_result.rc != 0 + failed_when: deployment_async_result.rc | default(-1) != 0 when: not ansible_check_mode|bool - name: "Check-mode for Run deployment {{ item }} (changed status indicates deployment would run)"