Don't error out on route53.list_tags_for_resource when resource has no tags
Without the added `return {}`, calling route53.list_tags_for_resource
when called with a ResourceId of a resource without any tags would
result in the error:
jinja2.exceptions.UndefinedError: 'None' has no attribute 'items'
Because the LIST_TAGS_FOR_RESOURCE_RESPONSE was given None instead of
empty dict.
This now allows list_tags_for_resource to be called without issue on
tag-less resources.
This commit is contained in:
parent
3a5d857a60
commit
35507f33df
2 changed files with 8 additions and 0 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue