Open hguermeur opened 1 year ago
Hi, Do you succeed to reproduce the issue ?
Thks, Hervé
I was able to reproduce the issue
t: [k0, k1]
l1:
- {k0: A, k1: B, k2: [""], k3: foo}
- {k0: C, k1: D, k2: [""], k3: bar}
r1: "{{ l1 | ansible.utils.remove_keys(target=t) }}"
gives
r1:
- k2: []
k3: foo
- k2: []
k3: bar
SUMMARY
Hi, I'm not sure if it is the expected behavior:
remove_keys
applied on[ "" ]
always return[ ]
in place of[ "" ]
ISSUE TYPE
COMPONENT NAME
ansible.utils.remove_keys
ANSIBLE VERSION
Same problem with:
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Not environment dependent.
STEPS TO REPRODUCE
File
test.yaml
:Playbook to run:
EXPECTED RESULTS
remove_keys
should not remove the empty string from theapiGroups
list:ACTUAL RESULTS
remove_keys
remove the empty string from theapiGroups
list (the ouput from the filterfrom_yaml
is OK). Same result withmatching_parameter=regex