]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ansible.git/commitdiff
ceph-facts: fix ansible templating error for auto osd discovery
authorpinotelio <ahmadreza.mollapour@gmail.com>
Mon, 4 Apr 2022 09:48:14 +0000 (14:18 +0430)
committerGuillaume Abrioux <gabrioux@redhat.com>
Wed, 13 Apr 2022 12:26:35 +0000 (14:26 +0200)
This commit fixes templating error that occurs when using auto osd discovery. Getting the len before converting the result to a list causes "object of type generator has no len()" error.

Signed-off-by: pinotelio <ahmadreza.mollapour@gmail.com>
roles/ceph-facts/tasks/devices.yml

index 6c4af65eca1febbd4b4b91abd4c49444a8db203f..4393f7cf3eabb500cccabee245575caec36be8ff 100644 (file)
@@ -87,5 +87,5 @@
     - item.value.sectors != "0"
     - item.value.partitions|count == 0
     - item.value.holders|count == 0
-    - ansible_facts['mounts'] | selectattr('device', 'equalto', device) | length == 0
+    - ansible_facts['mounts'] | selectattr('device', 'equalto', device) | list | length == 0
     - item.key is not match osd_auto_discovery_exclude