[sushy_emulator] Fix list handling for VM instances#3678
[sushy_emulator] Fix list handling for VM instances#3678holser wants to merge 1 commit intoopenstack-k8s-operators:mainfrom
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
d26f7a6 to
54cf81a
Compare
|
Build failed (check pipeline). Post https://softwarefactory-project.io/zuul/t/rdoproject.org/buildset/06565e38a53248ac9155519606efd3f4 ✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 54m 41s |
Remove regex replacement that converted list to string format. The variable should remain as a list for proper loop iteration in Ansible 2.16+. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Sergii Golovatiuk <sgolovat@redhat.com>
54cf81a to
d79c2ac
Compare
| {{ matching_vms }} | ||
| ansible.builtin.set_fact: | ||
| _cifmw_sushy_emulator_instances: "{{ _matching_vms | regex_replace('\n(?!.*\n)', ', ')}}" | ||
| _cifmw_sushy_emulator_instances: "{{ _matching_vms }}" |
There was a problem hiding this comment.
We need the regex to convert this to a comma separated string, instead of a \n line-break reparated string. Because it is the input for sushy emulator config file:
_matching_vms is of tpy string, not of type list.
hmm, so rethinking - the string would not be newline separated, it would be a ["uuid-0", "uuid-1", "uuid-2"] ?
so what we actually need is something like:
_cifmw_sushy_emulator_instances: "{{ _matching_vms | from_yaml }} or from_json ?
Remove regex replacement that converted list to string format. The
variable should remain as a list for proper loop iteration in
Ansible 2.16+.
Co-Authored-By: Claude noreply@anthropic.com
Signed-off-by: Sergii Golovatiuk sgolovat@redhat.com