ELBV2 - Ensure ResourceARN is returned when describing tags (#4990)

This commit is contained in:
Bert Blommers 2022-03-31 11:40:06 +00:00 committed by GitHub
parent bd6b90a6ab
commit d6bec75e43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 4 deletions

View File

@ -635,9 +635,9 @@ REMOVE_TAGS_TEMPLATE = """<RemoveTagsResponse xmlns="http://elasticloadbalancing
DESCRIBE_TAGS_TEMPLATE = """<DescribeTagsResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2015-12-01/">
<DescribeTagsResult>
<TagDescriptions>
{% for resource, tags in resource_tags.items() %}
{% for resource_arn, tags in resource_tags.items() %}
<member>
<ResourceArn>{{ resource.arn }}</ResourceArn>
<ResourceArn>{{ resource_arn }}</ResourceArn>
<Tags>
{% for key, value in tags.items() %}
<member>

View File

@ -30,10 +30,12 @@ def test_create_load_balancer():
)
lb.get("CreatedTime").tzinfo.should_not.be.none
lb.get("State").get("Code").should.equal("provisioning")
lb_arn = lb.get("LoadBalancerArn")
# Ensure the tags persisted
response = conn.describe_tags(ResourceArns=[lb.get("LoadBalancerArn")])
tags = {d["Key"]: d["Value"] for d in response["TagDescriptions"][0]["Tags"]}
tag_desc = conn.describe_tags(ResourceArns=[lb_arn])["TagDescriptions"][0]
tag_desc.should.have.key("ResourceArn").equals(lb_arn)
tags = {d["Key"]: d["Value"] for d in tag_desc["Tags"]}
tags.should.equal({"key_name": "a_value"})