Fix AutoScalingGroup tags in DescribeAutoScalingGroups

I'm not certain that this is the approach that's desired. It'd be nice
to dynamically convert the keys one way or the other. Looking for
feedback.

Signed-off-by: Scott Greene <scott.greene@getbraintree.com>
This commit is contained in:
Andrew Garrett 2016-02-29 19:50:28 +00:00 committed by Scott Greene
parent 99af8bdb79
commit 993087f2bb
2 changed files with 8 additions and 7 deletions

View File

@ -241,11 +241,11 @@ DESCRIBE_AUTOSCALING_GROUPS_TEMPLATE = """<DescribeAutoScalingGroupsResponse xml
<Tags>
{% for tag in group.tags %}
<member>
<ResourceType>{{ tag.resource_type }}</ResourceType>
<ResourceId>{{ tag.resource_id }}</ResourceId>
<PropagateAtLaunch>{{ tag.propagate_at_launch }}</PropagateAtLaunch>
<Key>{{ tag.key }}</Key>
<Value>{{ tag.value }}</Value>
<ResourceType>{{ tag.resource_type or tag.ResourceType }}</ResourceType>
<ResourceId>{{ tag.resource_id or tag.ResourceId }}</ResourceId>
<PropagateAtLaunch>{{ tag.propagate_at_launch or tag.PropagateAtLaunch }}</PropagateAtLaunch>
<Key>{{ tag.key or tag.Key }}</Key>
<Value>{{ tag.value or tag.Value }}</Value>
</member>
{% endfor %}
</Tags>

View File

@ -227,5 +227,6 @@ def test_stack_tags():
TemplateBody=dummy_template_json,
Tags=tags,
)
stack.tags.should.equal(tags)
observed_tag_items = set(item for items in [tag.items() for tag in stack.tags] for item in items)
expected_tag_items = set(item for items in [tag.items() for tag in tags] for item in items)
observed_tag_items.should.equal(expected_tag_items)