Test Fixes and tag: filter.
* fixed test_ec2.test_amis.test_ami_filters to test for AMIs in the state of 'available' * enhanced AMI's to be able to take `tag:` filter. * added tag: tests for AMIs
This commit is contained in:
parent
866d8b4ea8
commit
7fca88e732
2 changed files with 28 additions and 1 deletions
|
|
@ -606,6 +606,10 @@ class Ami(TaggedEC2Instance):
|
|||
return self.id
|
||||
elif filter_name == 'state':
|
||||
return self.state
|
||||
elif filter_name.startswith('tag:'):
|
||||
tag_name = filter_name.replace('tag:', '', 1)
|
||||
tags = dict((tag['key'], tag['value']) for tag in self.get_tags())
|
||||
return tags.get(tag_name)
|
||||
else:
|
||||
ec2_backend.raise_not_implemented_error("The filter '{0}' for DescribeImages".format(filter_name))
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue