Skip to content

Commit

Permalink
use scrub_non_parameters helper
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble authored Feb 13, 2021
1 parent a75130e commit 762d69f
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions plugins/modules/ec2_asg.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,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 snake_dict_to_camel_dict
from ansible_collections.amazon.aws.plugins.module_utils.ec2 import camel_dict_to_snake_dict
Expand Down Expand Up @@ -891,12 +892,7 @@ def get_launch_object(connection, ec2_connection):
instance_type_dict = {'InstanceType': instance_type}
policy['LaunchTemplate']['Overrides'].append(instance_type_dict)
if instances_distribution:
instances_distribution_params = dict(
(key, value)
for key, value
in instances_distribution.items()
if value is not None
)
instances_distribution_params = scrub_none_parameters(instances_distribution)
policy['InstancesDistribution'] = snake_dict_to_camel_dict(instances_distribution_params, capitalize_first=True)
launch_object['MixedInstancesPolicy'] = policy
return launch_object
Expand Down

0 comments on commit 762d69f

Please sign in to comment.