mirror of
https://github.com/linux-system-roles/network.git
synced 2026-01-23 02:15:17 +00:00
in lsr_assert_when use condition instead of when
ansible-lint is confused by the use of `when:` with `lsr_assert_when`. It thinks the `when` string should be evaluated as a Jinja expression but it is really just a plain string. To make this more friendly to ansible-lint, use `condition:` instead of `when:` with `lsr_assert_when`. Signed-off-by: Rich Megginson <rmeggins@redhat.com>
This commit is contained in:
parent
8eed9ae4a9
commit
7f26cdb8ac
2 changed files with 4 additions and 4 deletions
|
|
@ -31,7 +31,7 @@
|
|||
# Device should be present because of autoconnect: true by
|
||||
# default for NM (this might be considered a bug)
|
||||
- what: tasks/assert_device_present.yml
|
||||
when: network_provider == 'nm'
|
||||
condition: "{{ network_provider == 'nm' }}"
|
||||
lsr_cleanup:
|
||||
- tasks/cleanup_profile+device.yml
|
||||
|
||||
|
|
@ -103,7 +103,7 @@
|
|||
- tasks/assert_profile_absent.yml
|
||||
lsr_assert_when:
|
||||
- what: tasks/assert_device_absent.yml
|
||||
when: network_provider == 'nm'
|
||||
condition: "{{ network_provider == 'nm' }}"
|
||||
lsr_cleanup:
|
||||
- tasks/cleanup_profile+device.yml
|
||||
|
||||
|
|
@ -128,6 +128,6 @@
|
|||
- tasks/get_NetworkManager_NVR.yml
|
||||
lsr_assert_when:
|
||||
- what: tasks/assert_device_absent.yml
|
||||
when: network_provider == 'nm'
|
||||
condition: "{{ network_provider == 'nm' }}"
|
||||
lsr_cleanup:
|
||||
- tasks/cleanup_profile+device.yml
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@
|
|||
|
||||
- name: Conditional asserts
|
||||
include_tasks: "{{ item['what'] }}"
|
||||
when: item['when']
|
||||
when: item['condition']
|
||||
loop: "{{ lsr_assert_when | default([]) }}"
|
||||
|
||||
- name: "Success in test '{{ lsr_description }}'"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue