-
Notifications
You must be signed in to change notification settings - Fork 398
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
elements='dict' set suboptions to None values #251
Comments
What happens is that
No. 3 doesn't help for Ansible 2.9 and 2.10, so let's ignore that for now. No. 1 throws away some work, so I think the best solution is no. 2. It would probably be best to have a helper function for that - which I guess would belong into amazon.aws's module_utils? |
I've added a helper function (see above) in amazon.aws to begin to address this. Once that's merged i'll open a PR here to fix |
@wimnat Your helper function was merged. |
Ah, I commented in #230 but I guess it actually belongs here: The adding another conditional branch to elif isinstance(v, list):
clean_parameters[k] = [scrub_none_parameters(vv) if isinstance(vv, dict) else vv for vv in v] would be necessary. |
So I had a quick stab at this and something I thought was going to be easy is anything but. Perhaps you can provide some direction. I imported by helper function and then just tried to do this: module.params = scrub_none_parameters(module.params) I just end up with this
It seems changing module.params is difficult. Any thoughts on how to proceed? |
When
It would be nice if we can fix the launch_template module with the next release. |
@markuman the patch is definitely required and I will raise a PR for that. Using |
solved by #413 |
SUMMARY
059cf9e#diff-b6b6dcee788bed9e4eb606cc7bb24cddR2102
This commit introduces
elements='dict'
which results inNone
values for suboptions likeblock_device_mappings
ornetwork_interfaces
.With community.aws 1.0.0 everything is fine. Since 1.2.0 it gets broken.
The integration test does not cover it, because it set nor
block_device_mappings
nornetwork_interfaces
.@felixfontein and @s-hertel confirms this bug on #ansible-aws
ISSUE TYPE
COMPONENT NAME
ec2_launch_template
and maybe many more...
ANSIBLE VERSION
STEPS TO REPRODUCE
ACTUAL RESULTS
The text was updated successfully, but these errors were encountered: