Skip to content

Commit

Permalink
Drop extra call to describe_load_balancers
Browse files Browse the repository at this point in the history
  • Loading branch information
tremble committed Sep 26, 2023
1 parent 6b8506e commit 44b96b1
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions plugins/modules/elb_application_lb_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,15 +279,6 @@ 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, module, load_balancer_arn):
try:
return connection.describe_load_balancers(aws_retry=True, LoadBalancerArns=[load_balancer_arn])["LoadBalancers"][0][
"IpAddressType"
]
except (botocore.exceptions.ClientError, botocore.exceptions.BotoCoreError) as e:
module.fail_json_aws(e, msg="Failed to describe load balancer ip address type")


def list_load_balancers(connection, module):
load_balancer_arns = module.params.get("load_balancer_arns")
names = module.params.get("names")
Expand Down Expand Up @@ -318,11 +309,6 @@ def list_load_balancers(connection, module):
for listener in load_balancer["listeners"]:
listener["rules"] = get_listener_rules(connection, module, listener["ListenerArn"])

# Get ALB ip address type
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

0 comments on commit 44b96b1

Please sign in to comment.