Skip to content

Commit

Permalink
ec2_launch_template - scrub None parameters from what we'll pass to c…
Browse files Browse the repository at this point in the history
…reate_launch_config (ansible-collections#413)

* ec2_launch_template - scrub None parameters from what we'll pass to create_launch_config
* tests
* changelog
  • Loading branch information
tremble authored Mar 16, 2021
1 parent 5df6d88 commit a95f0b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ec2_launch_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -398,6 +398,7 @@

from ansible_collections.amazon.aws.plugins.module_utils.core import AnsibleAWSModule
from ansible_collections.amazon.aws.plugins.module_utils.core import is_boto3_error_code
from ansible_collections.amazon.aws.plugins.module_utils.core import scrub_none_parameters
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import AWSRetry
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import ansible_dict_to_boto3_tag_list
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import boto3_tag_list_to_ansible_dict
Expand Down Expand Up @@ -512,6 +513,7 @@ def create_or_update(module, template_options):
template, template_versions = existing_templates(module)
out = {}
lt_data = params_to_launch_data(module, dict((k, v) for k, v in module.params.items() if k in template_options))
lt_data = scrub_none_parameters(lt_data, descend_into_lists=True)
if not (template or template_versions):
# create a full new one
try:
Expand Down

0 comments on commit a95f0b2

Please sign in to comment.