Implement ImageId parameter in DescribeImages

This commit is contained in:
Ilya Sukhanov 2013-08-29 23:06:11 -04:00
commit a63601e481
3 changed files with 17 additions and 4 deletions

View file

@ -215,8 +215,12 @@ class AmiBackend(object):
self.amis[ami_id] = ami
return ami
def describe_images(self):
return self.amis.values()
def describe_images(self, ami_ids=None):
if ami_ids:
images = [image for image in self.amis.values() if image.id in ami_ids]
else:
images = self.amis.values()
return images
def deregister_image(self, ami_id):
if ami_id in self.amis: