Skip to content

Commit

Permalink
Update ec2_import_image.py
Browse files Browse the repository at this point in the history
Use scrub_none_parameters
  • Loading branch information
alinabuzachis committed Oct 24, 2023
1 parent 1617507 commit 7c74391
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions plugins/modules/ec2_import_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@
from ansible_collections.amazon.aws.plugins.module_utils.retries import AWSRetry
from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_list_to_ansible_dict
from ansible_collections.amazon.aws.plugins.module_utils.tagging import boto3_tag_specifications
from ansible_collections.amazon.aws.plugins.module_utils.transformation import scrub_none_parameters


def ensure_ec2_import_image_result(import_image_info):
Expand Down Expand Up @@ -423,6 +424,8 @@ def present(client, module):
if module.check_mode:
module.exit_json(changed=True, msg="Would have created the import task if not in check mode")

params = scrub_none_parameters(params)

try:
client.import_image(aws_retry=True, **params)
import_image_info = helper_describe_import_image_tasks(client, module, **filters)
Expand Down

0 comments on commit 7c74391

Please sign in to comment.