Avoid shadowing loop variables. (#738)

This commit is contained in:
Felix Fontein
2024-01-02 14:21:19 +01:00
committed by GitHub
parent 2caa77c032
commit 39717d380e
28 changed files with 216 additions and 185 deletions
@@ -23,6 +23,8 @@
- include_tasks: run-test.yml - include_tasks: run-test.yml
with_fileglob: with_fileglob:
- "tests/*.yml" - "tests/*.yml"
loop_control:
loop_var: test_name
always: always:
- name: "Make sure all containers are removed" - name: "Make sure all containers are removed"
@@ -3,5 +3,5 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: "Loading tasks from {{ item }}" - name: "Loading tasks from {{ test_name }}"
include_tasks: "{{ item }}" include_tasks: "{{ test_name }}"
@@ -37,6 +37,8 @@
- include_tasks: run-test.yml - include_tasks: run-test.yml
with_fileglob: with_fileglob:
- "tests/*.yml" - "tests/*.yml"
loop_control:
loop_var: test_name
always: always:
- name: "Make sure all containers are removed" - name: "Make sure all containers are removed"
@@ -3,5 +3,5 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: "Loading tasks from {{ item }}" - name: "Loading tasks from {{ test_name }}"
include_tasks: "{{ item }}" include_tasks: "{{ test_name }}"
@@ -29,6 +29,8 @@
- include_tasks: run-test.yml - include_tasks: run-test.yml
with_fileglob: with_fileglob:
- "tests/*.yml" - "tests/*.yml"
loop_control:
loop_var: test_name
always: always:
- name: "Make sure all containers are removed" - name: "Make sure all containers are removed"
@@ -3,5 +3,5 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: "Loading tasks from {{ item }}" - name: "Loading tasks from {{ test_name }}"
include_tasks: "{{ item }}" include_tasks: "{{ test_name }}"
@@ -3,5 +3,5 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: "Loading tasks from {{ item }}" - name: "Loading tasks from {{ test_name }}"
include_tasks: "{{ item }}" include_tasks: "{{ test_name }}"
@@ -34,6 +34,8 @@
- include_tasks: run-test.yml - include_tasks: run-test.yml
with_fileglob: with_fileglob:
- "tests/*.yml" - "tests/*.yml"
loop_control:
loop_var: test_name
always: always:
- name: "Make sure all images are removed" - name: "Make sure all images are removed"
@@ -3,5 +3,5 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: "Loading tasks from {{ item }}" - name: "Loading tasks from {{ test_name }}"
include_tasks: "{{ item }}" include_tasks: "{{ test_name }}"
@@ -37,6 +37,8 @@
- include_tasks: run-test.yml - include_tasks: run-test.yml
with_fileglob: with_fileglob:
- "tests/*.yml" - "tests/*.yml"
loop_control:
loop_var: test_name
always: always:
- name: "Make sure all images are removed" - name: "Make sure all images are removed"
@@ -3,5 +3,5 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: "Loading tasks from {{ item }}" - name: "Loading tasks from {{ test_name }}"
include_tasks: "{{ item }}" include_tasks: "{{ test_name }}"
@@ -18,6 +18,8 @@
- include_tasks: run-test.yml - include_tasks: run-test.yml
with_fileglob: with_fileglob:
- "tests/*.yml" - "tests/*.yml"
loop_control:
loop_var: test_name
always: always:
- name: "Make sure all images are removed" - name: "Make sure all images are removed"
@@ -3,5 +3,5 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: "Loading tasks from {{ item }}" - name: "Loading tasks from {{ test_name }}"
include_tasks: "{{ item }}" include_tasks: "{{ test_name }}"
@@ -18,6 +18,8 @@
- include_tasks: run-test.yml - include_tasks: run-test.yml
with_fileglob: with_fileglob:
- "tests/*.yml" - "tests/*.yml"
loop_control:
loop_var: test_name
always: always:
- name: "Make sure all images are removed" - name: "Make sure all images are removed"
@@ -3,5 +3,5 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: "Loading tasks from {{ item }}" - name: "Loading tasks from {{ test_name }}"
include_tasks: "{{ item }}" include_tasks: "{{ test_name }}"
@@ -18,6 +18,8 @@
- include_tasks: run-test.yml - include_tasks: run-test.yml
with_fileglob: with_fileglob:
- "tests/*.yml" - "tests/*.yml"
loop_control:
loop_var: test_name
always: always:
- name: "Make sure all images are removed" - name: "Make sure all images are removed"
@@ -3,5 +3,5 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: "Loading tasks from {{ item }}" - name: "Loading tasks from {{ test_name }}"
include_tasks: "{{ item }}" include_tasks: "{{ test_name }}"
@@ -7,6 +7,8 @@
- include_tasks: run-test.yml - include_tasks: run-test.yml
with_fileglob: with_fileglob:
- "tests/*.yml" - "tests/*.yml"
loop_control:
loop_var: test_name
when: docker_api_version is version('1.25', '>=') when: docker_api_version is version('1.25', '>=')
- fail: msg="Too old docker / docker-py version to run docker_image tests!" - fail: msg="Too old docker / docker-py version to run docker_image tests!"
@@ -31,6 +31,8 @@
- include_tasks: run-test.yml - include_tasks: run-test.yml
with_fileglob: with_fileglob:
- "tests/*.yml" - "tests/*.yml"
loop_control:
loop_var: test_name
always: always:
- name: "Make sure all containers are removed" - name: "Make sure all containers are removed"
@@ -3,5 +3,5 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: "Loading tasks from {{ item }}" - name: "Loading tasks from {{ test_name }}"
include_tasks: "{{ item }}" include_tasks: "{{ test_name }}"
@@ -20,6 +20,8 @@
- include_tasks: run-test.yml - include_tasks: run-test.yml
with_fileglob: with_fileglob:
- "tests/*.yml" - "tests/*.yml"
loop_control:
loop_var: test_name
always: always:
- name: "Make sure plugin is removed" - name: "Make sure plugin is removed"
@@ -3,5 +3,5 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: "Loading tasks from {{ item }}" - name: "Loading tasks from {{ test_name }}"
include_tasks: "{{ item }}" include_tasks: "{{ test_name }}"
@@ -14,9 +14,11 @@
- docker_api_version is version('1.25', '>=') - docker_api_version is version('1.25', '>=')
block: block:
- include_tasks: "{{ item }}" - include_tasks: run-test.yml
with_fileglob: with_fileglob:
- 'tests/*.yml' - "tests/*.yml"
loop_control:
loop_var: test_name
always: always:
- import_tasks: cleanup.yml - import_tasks: cleanup.yml
@@ -2,3 +2,6 @@
# Copyright (c) Ansible Project # Copyright (c) Ansible Project
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: "Loading tasks from {{ test_name }}"
include_tasks: "{{ test_name }}"
@@ -32,6 +32,8 @@
- include_tasks: run-test.yml - include_tasks: run-test.yml
with_fileglob: with_fileglob:
- "tests/*.yml" - "tests/*.yml"
loop_control:
loop_var: test_name
always: always:
- name: Make sure all services are removed - name: Make sure all services are removed
@@ -3,5 +3,5 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: "Loading tasks from {{ item }}" - name: "Loading tasks from {{ test_name }}"
include_tasks: "{{ item }}" include_tasks: "{{ test_name }}"
@@ -20,6 +20,8 @@
- include_tasks: run-test.yml - include_tasks: run-test.yml
with_fileglob: with_fileglob:
- "tests/*.yml" - "tests/*.yml"
loop_control:
loop_var: test_name
always: always:
- name: "Make sure all volumes are removed" - name: "Make sure all volumes are removed"
@@ -3,5 +3,5 @@
# GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt) # GNU General Public License v3.0+ (see LICENSES/GPL-3.0-or-later.txt or https://www.gnu.org/licenses/gpl-3.0.txt)
# SPDX-License-Identifier: GPL-3.0-or-later # SPDX-License-Identifier: GPL-3.0-or-later
- name: "Loading tasks from {{ item }}" - name: "Loading tasks from {{ test_name }}"
include_tasks: "{{ item }}" include_tasks: "{{ test_name }}"