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 b35055c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
bugfixes:
- elb_application_lb_info - ensure all API queries use the retry decorator (https://github.com/ansible-collections/amazon.aws/issues/1767).
minor_changes:
- elb_application_lb_info - drop redundant ``describe_load_balancers`` call fetching ``ip_address_type`` (https://github.com/ansible-collections/amazon.aws/pull/1768).
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 b35055c

Please sign in to comment.