Commit 13af72a8 by Feanil Patel

Add an alias and make sure tagging works for names even if no other tags specified.

parent fa3ea122
...@@ -176,8 +176,9 @@ class SubnetManager: ...@@ -176,8 +176,9 @@ class SubnetManager:
:return: None :return: None
""" """
tags = {'Name': self.name} tags = {'Name': self.name}
for tag in self.tags: if self.tags:
tags[tag['key']] = tag['value'] for tag in self.tags:
tags[tag['key']] = tag['value']
self.subnet.add_tags(tags) self.subnet.add_tags(tags)
...@@ -189,7 +190,7 @@ def main(): ...@@ -189,7 +190,7 @@ def main():
name=dict(required=True, type='str'), name=dict(required=True, type='str'),
state=dict(default='present', choices=['present', 'absent']), state=dict(default='present', choices=['present', 'absent']),
vpc_id=dict(required=True, type='str'), vpc_id=dict(required=True, type='str'),
cidr_block=dict(required=True, type='str'), cidr_block=dict(required=True, type='str', aliases=['cidr']),
az=dict(required=True, type='str'), az=dict(required=True, type='str'),
route_table_id=dict(required=True, type='str'), route_table_id=dict(required=True, type='str'),
network_acl_id=dict(type='str'), network_acl_id=dict(type='str'),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment