Removed for loop
This commit is contained in:
parent
a2f731b710
commit
817abb2ca8
|
@ -160,8 +160,8 @@ def get_load_balancer_arn_from_endpoint(endpoint_name, **kwargs):
|
||||||
try:
|
try:
|
||||||
client = kwargs.pop("client")
|
client = kwargs.pop("client")
|
||||||
elbs = client.describe_load_balancers(Names=[endpoint_name])
|
elbs = client.describe_load_balancers(Names=[endpoint_name])
|
||||||
for elb in elbs["LoadBalancers"]:
|
if "LoadBalancers" in elbs and elbs["LoadBalancers"]:
|
||||||
return elb["LoadBalancerArn"]
|
return elbs["LoadBalancers"][0]["LoadBalancerArn"]
|
||||||
|
|
||||||
except Exception as e: # noqa
|
except Exception as e: # noqa
|
||||||
metrics.send(
|
metrics.send(
|
||||||
|
|
Loading…
Reference in New Issue