Skip to content

Commit

Permalink
selectattr evaluates as boolean by default
Browse files Browse the repository at this point in the history
  • Loading branch information
spetrosi committed Jan 8, 2024
1 parent f387476 commit 7317c63
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions tests/tests_add_rm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- name: Set fact with the default kernel to use for clones
set_fact:
test_kernel: "{{ bootloader_facts | rejectattr('initrd', 'undefined')
| selectattr('default', 'equalto', True) | first }}"
| selectattr('default') | first }}"

- name: Clone test_kernel kernel and initrd for test purposes
copy:
Expand Down Expand Up @@ -74,7 +74,7 @@
vars:
__default_args: "{{
(bootloader_facts | selectattr('title', 'defined') |
selectattr('default', 'equalto', True) |
selectattr('default') |
first).args }}"
assert:
that: >-
Expand Down
2 changes: 1 addition & 1 deletion tests/tests_settings.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
- name: Verify that default bootloader is correct in bootloader_gather_facts
vars:
default_bootloader: "{{
(bootloader_facts | selectattr('default', 'equalto', True) |
(bootloader_facts | selectattr('default') |
first).kernel }}"
command: grubby --default-kernel
changed_when: false
Expand Down

0 comments on commit 7317c63

Please sign in to comment.