Fix inspecting refstack_result

refstack_result is used to register result of running
refstack-client, however, it was used in 2 different tasks one of
which was always skipped. There may happen a situation (when the
latter task is skipped), the skipped task overrides the result
of the refstack-client execution from the other task.
The patch fixes that by using a different variable for each of
the tasks running refstack-client.

Change-Id: I6f524df674dfbb2d6b9372dce51f1e1aec8ed9be
This commit is contained in:
Martin Kopec 2021-05-17 07:54:35 +00:00
parent 82b5f4de5e
commit f865af4563
2 changed files with 4 additions and 4 deletions

View File

@ -40,6 +40,6 @@
- name: Check if we passed tests of all specified target programs
fail:
msg: "Refstack tests failed."
# the refstack_result var got set in run-refstack-client.yaml
# the refstack_results var got set in run-refstack-client.yaml
when: item.rc > 0
with_items: "{{ refstack_result.results }}"
with_items: "{{ refstack_results.results }}"

View File

@ -44,9 +44,9 @@
args:
chdir: "{{ refstack_client_source }}"
executable: /bin/bash
register: refstack_result
register: refstack_results
# don't fail here in order to allow post_tasks be executed,
# the refstack_result is inspected in the last task of the role where it
# the refstack_results is inspected in the last task of the role where it
# fails if it failed here
ignore_errors: true
with_items: "{{ refstack_target_programs }}"