Properly implement ec2.get_all_instances filtering by instance id
This commit is contained in:
parent
b8957e0c6e
commit
fda5f83f87
3 changed files with 43 additions and 1 deletions
|
|
@ -7,8 +7,13 @@ from moto.ec2.utils import instance_ids_from_querystring
|
|||
|
||||
class InstanceResponse(object):
|
||||
def describe_instances(self):
|
||||
instance_ids = instance_ids_from_querystring(self.querystring)
|
||||
template = Template(EC2_DESCRIBE_INSTANCES)
|
||||
return template.render(reservations=ec2_backend.all_reservations())
|
||||
if instance_ids:
|
||||
reservations = ec2_backend.get_reservations_by_instance_ids(instance_ids)
|
||||
else:
|
||||
reservations = ec2_backend.all_reservations()
|
||||
return template.render(reservations=reservations)
|
||||
|
||||
def run_instances(self):
|
||||
min_count = int(self.querystring.get('MinCount', ['1'])[0])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue