public inbox for kdevops@lists.linux.dev
 help / color / mirror / Atom feed
From: Daniel Gomez <da.gomez@kernel.org>
To: kdevops@lists.linux.dev, Luis Chamberlain <mcgrof@kernel.org>
Cc: Daniel Gomez <da.gomez@samsung.com>, Daniel Gomez <da.gomez@kernel.org>
Subject: [PATCH 3/5] create_partition: fix using atribute append of list object
Date: Mon, 12 May 2025 16:36:14 +0200	[thread overview]
Message-ID: <20250512-vagrant-fixes-v1-3-3dcfd0a380ba@samsung.com> (raw)
In-Reply-To: <20250512-vagrant-fixes-v1-0-3dcfd0a380ba@samsung.com>

From: Daniel Gomez <da.gomez@samsung.com>

TASK [create_partition : Partitions | Collect
partition information onto part_mounts]
task path:
/scratch/dagomez/linux-kdevops/kdevops/playbooks/roles/create_partition/
tasks/main.yml:93
[ERROR]: Task failed: Finalization of task args for
'ansible.builtin.set_fact' failed: Error while resolving value for
'part_mounts': access to attribute 'append' of 'list' object is unsafe.

Task failed.
Origin:
/scratch/dagomez/linux-kdevops/kdevops/playbooks/roles/create_partition/
tasks/main.yml:93:3

91   tags: [ 'partition' ]
92
93 - name: Partitions | Collect partition information onto part_mounts
     ^ column 3

<<< caused by >>>

Finalization of task args for 'ansible.builtin.set_fact' failed.
Origin:
/scratch/dagomez/linux-kdevops/kdevops/playbooks/roles/create_partition/
tasks/main.yml:94:3

92
93 - name: Partitions | Collect partition information onto part_mounts
94   set_fact:
     ^ column 3

<<< caused by >>>

Error while resolving value for 'part_mounts': access to attribute
'append' of 'list' object is unsafe.
Origin:
/scratch/dagomez/linux-kdevops/kdevops/playbooks/roles/create_partition/
tasks/main.yml:95:18

93 - name: Partitions | Collect partition information onto part_mounts
94   set_fact:
95     part_mounts: |
                    ^ column 18

fatal: [debian13-btrfs-simple]: FAILED! => {
    "changed": false,
    "msg": "Task failed: Finalization of task args for
'ansible.builtin.set_fact' failed: Error while resolving value for
'part_mounts': access to attribute 'append' of 'list' object is unsafe."
}

PLAY RECAP
debian13-btrfs-simple      : ok=23   changed=2    unreachable=0
failed=1    skipped=20   rescued=0    ignored=0

Signed-off-by: Daniel Gomez <da.gomez@samsung.com>
---
 playbooks/roles/create_partition/tasks/main.yml | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/playbooks/roles/create_partition/tasks/main.yml b/playbooks/roles/create_partition/tasks/main.yml
index 014ed5ac3b554d450b68bcc40f095f07517fc205..8e72263c50c68784e1421dd0dc780f4b6a09d6a3 100644
--- a/playbooks/roles/create_partition/tasks/main.yml
+++ b/playbooks/roles/create_partition/tasks/main.yml
@@ -92,12 +92,7 @@
 
 - name: Partitions | Collect partition information onto part_mounts
   set_fact:
-    part_mounts: |
-      {%- set x = [] -%}
-      {%- for line in result.stdout_lines -%}
-      {{ x.append(line.split()) }}
-      {%- endfor -%}
-      {{ x }}
+    part_mounts: "{{ result.stdout_lines | map('split') | list }}"
   when: >
     result is success and
     result.stdout_lines is defined

-- 
2.49.0


  parent reply	other threads:[~2025-05-12 14:36 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-12 14:36 [PATCH 0/5] Ansible fixes in different roles Daniel Gomez
2025-05-12 14:36 ` [PATCH 1/5] gen_nodes: remove vagrant tasks Daniel Gomez
2025-05-12 14:36 ` [PATCH 2/5] update_ssh_config_guestfs: fix broken conditionals Daniel Gomez
2025-05-12 14:36 ` Daniel Gomez [this message]
2025-05-12 14:36 ` [PATCH 4/5] gen_hosts: blktests: fix hosts names generation Daniel Gomez
2025-05-12 14:36 ` [PATCH 5/5] gen_nodes: " Daniel Gomez
2025-05-14 18:32 ` [PATCH 0/5] Ansible fixes in different roles Luis Chamberlain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250512-vagrant-fixes-v1-3-3dcfd0a380ba@samsung.com \
    --to=da.gomez@kernel.org \
    --cc=da.gomez@samsung.com \
    --cc=kdevops@lists.linux.dev \
    --cc=mcgrof@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox