Added support for filtering AMIs by self (#1398)
* Added support for filtering AMIs by self Closes: https://github.com/spulec/moto/issues/1396 * Adjusted regex to also match signature v4 and fixed py3 compatibility
This commit is contained in:
parent
71af9317f2
commit
56ce26a728
4 changed files with 44 additions and 6 deletions
|
|
@ -11,7 +11,7 @@ class AmisResponse(BaseResponse):
|
|||
instance_id = self._get_param('InstanceId')
|
||||
if self.is_not_dryrun('CreateImage'):
|
||||
image = self.ec2_backend.create_image(
|
||||
instance_id, name, description)
|
||||
instance_id, name, description, context=self)
|
||||
template = self.response_template(CREATE_IMAGE_RESPONSE)
|
||||
return template.render(image=image)
|
||||
|
||||
|
|
@ -39,7 +39,8 @@ class AmisResponse(BaseResponse):
|
|||
owners = self._get_multi_param('Owner')
|
||||
exec_users = self._get_multi_param('ExecutableBy')
|
||||
images = self.ec2_backend.describe_images(
|
||||
ami_ids=ami_ids, filters=filters, exec_users=exec_users, owners=owners)
|
||||
ami_ids=ami_ids, filters=filters, exec_users=exec_users,
|
||||
owners=owners, context=self)
|
||||
template = self.response_template(DESCRIBE_IMAGES_RESPONSE)
|
||||
return template.render(images=images)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue