Check to make sure key exists in tag list before using it

Fixes #7910
This commit is contained in:
James Cammarata 2014-06-24 12:16:57 -05:00
parent 936daf6f63
commit c61d04dd1f

View file

@ -209,6 +209,8 @@ def create_autoscaling_group(connection, module):
existing_tags = as_group.tags existing_tags = as_group.tags
existing_tag_map = dict((tag.key, tag) for tag in existing_tags) existing_tag_map = dict((tag.key, tag) for tag in existing_tags)
for tag in set_tags: for tag in set_tags:
if 'key' not in tag:
continue
if ( not tag['key'] in existing_tag_map or if ( not tag['key'] in existing_tag_map or
existing_tag_map[tag['key']].value != tag['value'] or existing_tag_map[tag['key']].value != tag['value'] or
('propagate_at_launch' in tag and ('propagate_at_launch' in tag and