Skip to content

Commit

Permalink
lint validation
Browse files Browse the repository at this point in the history
  • Loading branch information
abikouo committed Mar 29, 2021
1 parent f078335 commit 49c303c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 10 deletions.
1 change: 0 additions & 1 deletion plugins/modules/elb_application_lb.py
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,6 @@
ip_address_type:
description:
- Sets the type of IP addresses used by the subnets of the specified Application Load Balancer.
default: "ipv4"
choices: [ 'ipv4', 'dualstack' ]
type: str
extends_documentation_fragment:
Expand Down
8 changes: 2 additions & 6 deletions plugins/modules/elb_application_lb_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,6 @@
description: The ID of the VPC for the load balancer.
type: str
sample: vpc-0011223344
ip_address_type:
description: The type of IP addresses used by the subnets for the load balancer.
type: str
sample: ipv4
'''

try:
Expand Down Expand Up @@ -199,7 +195,7 @@ def get_load_balancer_tags(connection, module, load_balancer_arn):
module.fail_json_aws(e, msg="Failed to describe load balancer tags")


def get_load_balancer_ipaddresstype(connection, load_balancer_arn) :
def get_load_balancer_ipaddresstype(connection, module, load_balancer_arn) :
try:
return connection.describe_load_balancers(LoadBalancerArns=[load_balancer_arn])['LoadBalancers'][0]['IpAddressType']
except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
Expand Down Expand Up @@ -235,7 +231,7 @@ def list_load_balancers(connection, module):
listener['rules'] = get_listener_rules(connection, module, listener['ListenerArn'])

# Get ELB ip address type
load_balancer['IpAddressType']=get_load_balancer_ipaddresstype(connection, load_balancer['LoadBalancerArn'])
load_balancer['IpAddressType']=get_load_balancer_ipaddresstype(connection,module,load_balancer['LoadBalancerArn'])

# Turn the boto3 result in to ansible_friendly_snaked_names
snaked_load_balancers = [camel_dict_to_snake_dict(load_balancer) for load_balancer in load_balancers['LoadBalancers']]
Expand Down
5 changes: 2 additions & 3 deletions plugins/modules/elb_network_lb.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@
ip_address_type:
description:
- Sets the type of IP addresses used by the subnets of the specified Application Load Balancer.
default: "ipv4"
choices: [ 'ipv4', 'dualstack' ]
type: str
extends_documentation_fragment:
Expand Down Expand Up @@ -385,7 +384,7 @@ def create_or_update_elb(elb_obj):
elb_obj.update_elb_attributes()

# Update ELB ip address type only if option has been provided
if elb_obj.module.params.get('ip_address_type') is not None :
if elb_obj.module.params.get('ip_address_type') is not None:
elb_obj.modify_ip_address_type(elb_obj.module.params.get('ip_address_type'))

# Convert to snake_case and merge in everything we want to return to the user
Expand All @@ -399,7 +398,7 @@ def create_or_update_elb(elb_obj):
snaked_elb['tags'] = boto3_tag_list_to_ansible_dict(snaked_elb['tags'])

# ip address type
snaked_elb['ip_address_type']=elb_obj.get_elb_ip_address_type()
snaked_elb['ip_address_type'] = elb_obj.get_elb_ip_address_type()

elb_obj.module.exit_json(changed=elb_obj.changed, **snaked_elb)

Expand Down

0 comments on commit 49c303c

Please sign in to comment.