From b5e87e62f1ff03dd80067aa1ec297007770301ce Mon Sep 17 00:00:00 2001 From: Albin Vass Date: Tue, 28 Apr 2020 18:35:10 +0000 Subject: [PATCH] Revert "Do not set buildset_fact if it's not present in results.json" This reverts commit bc0ca442a11fee5c610a71b50d8d0073d5293d2b. Change-Id: If0885877a1c976ed430d6e3a7a462e06042874fb --- roles/build-container-image/tasks/main.yaml | 11 ++--------- roles/build-docker-image/tasks/main.yaml | 11 ++--------- roles/collect-container-logs/tasks/main.yaml | 2 +- 3 files changed, 5 insertions(+), 19 deletions(-) diff --git a/roles/build-container-image/tasks/main.yaml b/roles/build-container-image/tasks/main.yaml index 39d22a07c..42dfd716a 100644 --- a/roles/build-container-image/tasks/main.yaml +++ b/roles/build-container-image/tasks/main.yaml @@ -1,16 +1,9 @@ -- name: Check for results.json - stat: - path: "{{ zuul.executor.work_root }}/results.json" - register: result_json_stat - # This can be removed if we add this functionality to Zuul directly - name: Load information from zuul_return + when: buildset_registry is not defined set_fact: buildset_registry: "{{ (lookup('file', zuul.executor.work_root + '/results.json') | from_json)['buildset_registry'] }}" - when: - - buildset_registry is not defined - - result_json_stat.stat.exists - - "'buildset_registry' in (lookup('file', zuul.executor.work_root + '/results.json') | from_json)" + ignore_errors: true - name: Set container filename arg set_fact: diff --git a/roles/build-docker-image/tasks/main.yaml b/roles/build-docker-image/tasks/main.yaml index 53c00e40d..c5d089880 100644 --- a/roles/build-docker-image/tasks/main.yaml +++ b/roles/build-docker-image/tasks/main.yaml @@ -1,16 +1,9 @@ -- name: Check for results.json - stat: - path: "{{ zuul.executor.work_root }}/results.json" - register: result_json_stat - # This can be removed if we add this functionality to Zuul directly - name: Load information from zuul_return + when: buildset_registry is not defined set_fact: buildset_registry: "{{ (lookup('file', zuul.executor.work_root + '/results.json') | from_json)['buildset_registry'] }}" - when: - - buildset_registry is not defined - - result_json_stat.stat.exists - - "'buildset_registry' in (lookup('file', zuul.executor.work_root + '/results.json') | from_json)" + ignore_errors: true - name: Build docker images include_tasks: build.yaml diff --git a/roles/collect-container-logs/tasks/main.yaml b/roles/collect-container-logs/tasks/main.yaml index ea5800d88..beb658efd 100644 --- a/roles/collect-container-logs/tasks/main.yaml +++ b/roles/collect-container-logs/tasks/main.yaml @@ -1,7 +1,7 @@ - name: List containers command: "{{ container_command }} ps -a --format '{{ '{{ .Names }}' }}'" register: docker_containers - failed_when: false + ignore_errors: true - name: Create container log dir file: