Skip to content

Commit

Permalink
fs2bs: use match filter in selectattr()
Browse files Browse the repository at this point in the history
0990ae4 changed the filter in
selectattr() from 'match' to 'equalto' but due to an incompatibility with
the Jinja2 version for python 2.7 on el7 we must stick to using 'match'
filter.

Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
(cherry picked from commit d6745e9)
  • Loading branch information
guits committed May 26, 2021
1 parent 5ece236 commit dc0d028
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions infrastructure-playbooks/filestore-to-bluestore.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
set_fact:
osd_ids: "{{ osd_ids | default([]) | union(item) }}"
with_items:
- "{{ ((osd_tree.stdout | default('{}') | trim | from_json).nodes | selectattr('name', 'equalto', inventory_hostname) | map(attribute='children') | list) }}"
- "{{ ((osd_tree.stdout | default('{}') | trim | from_json).nodes | selectattr('name', 'match', '^' + inventory_hostname + '$') | map(attribute='children') | list) }}"

- name: get osd metadata
command: "{{ container_exec_cmd }} ceph --cluster {{ cluster }} osd metadata osd.{{ item }} -f json"
Expand Down Expand Up @@ -310,7 +310,7 @@
set_fact:
osd_ids: "{{ osd_ids | default([]) + [item] }}"
with_items:
- "{{ ((osd_tree.stdout | default('{}') | from_json).nodes | selectattr('name', 'equalto', inventory_hostname) | map(attribute='children') | list) }}"
- "{{ ((osd_tree.stdout | default('{}') | from_json).nodes | selectattr('name', 'match', '^' + inventory_hostname + '$') | map(attribute='children') | list) }}"

- name: purge osd(s) from the cluster
command: >
Expand Down

0 comments on commit dc0d028

Please sign in to comment.