Merge pull request #2399 from dkuntz2/route53-fix-empty-tags

Don't error out on route53.list_tags_for_resource when resource has no tags
This commit is contained in:
Steve Pulec 2019-09-11 21:50:25 -05:00 committed by GitHub
commit 0f3957ffad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -305,6 +305,7 @@ class Route53Backend(BaseBackend):
def list_tags_for_resource(self, resource_id):
if resource_id in self.resource_tags:
return self.resource_tags[resource_id]
return {}
def get_all_hosted_zones(self):
return self.zones.values()

View File

@ -404,6 +404,11 @@ def test_list_or_change_tags_for_resource_request():
)
healthcheck_id = health_check['HealthCheck']['Id']
# confirm this works for resources with zero tags
response = conn.list_tags_for_resource(
ResourceType="healthcheck", ResourceId=healthcheck_id)
response["ResourceTagSet"]["Tags"].should.be.empty
tag1 = {"Key": "Deploy", "Value": "True"}
tag2 = {"Key": "Name", "Value": "UnitTest"}