From f8e854a6737dee0663d6e6e732e209a317a9dfa0 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 (cherry picked from commit 2cd1fbd87bfde7ec318356178d1ca4c68859e916) (cherry picked from commit 64e0dc7fdf69bb4363764efcf4536f938803c76e) (cherry picked from commit f105287f17242ef7570a34b6817af3032edc912a) --- 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 6543c6513..ffebab55e 100644 --- a/tripleo_common/templates/deployments.yaml +++ b/tripleo_common/templates/deployments.yaml @@ -193,11 +193,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)"