FIX:Ec2:Added:Tags for EIP (#3505)
* FIX:Ec2:Added:Tags for EIP * removed files * Fix tests
This commit is contained in:
parent
8f83f51897
commit
cfaaa70ea9
3 changed files with 28 additions and 1 deletions
|
|
@ -226,7 +226,9 @@ class StateReason(object):
|
|||
|
||||
class TaggedEC2Resource(BaseModel):
|
||||
def get_tags(self, *args, **kwargs):
|
||||
tags = self.ec2_backend.describe_tags(filters={"resource-id": [self.id]})
|
||||
tags = []
|
||||
if self.id:
|
||||
tags = self.ec2_backend.describe_tags(filters={"resource-id": [self.id]})
|
||||
return tags
|
||||
|
||||
def add_tag(self, key, value):
|
||||
|
|
|
|||
|
|
@ -151,6 +151,16 @@ DESCRIBE_ADDRESS_RESPONSE = """<DescribeAddressesResponse xmlns="http://ec2.amaz
|
|||
{% if address.association_id %}
|
||||
<associationId>{{ address.association_id }}</associationId>
|
||||
{% endif %}
|
||||
<tagSet>
|
||||
{% for tag in address.get_tags() %}
|
||||
<item>
|
||||
<resourceId>{{ tag.resource_id }}</resourceId>
|
||||
<resourceType>{{ tag.resource_type }}</resourceType>
|
||||
<key>{{ tag.key }}</key>
|
||||
<value>{{ tag.value }}</value>
|
||||
</item>
|
||||
{% endfor %}
|
||||
</tagSet>
|
||||
</item>
|
||||
{% endfor %}
|
||||
</addressesSet>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue