Commit 19bf388a by Michael DeHaan

Merge pull request #8353 from gdamjan/ec2-running-return-info

return the most up-to-date info about an instance when starting/stopping it
parents d727b793 16e5b1b9
...@@ -1083,10 +1083,12 @@ def startstop_instances(module, ec2, instance_ids, state): ...@@ -1083,10 +1083,12 @@ def startstop_instances(module, ec2, instance_ids, state):
## Wait for all the instances to finish starting or stopping ## Wait for all the instances to finish starting or stopping
wait_timeout = time.time() + wait_timeout wait_timeout = time.time() + wait_timeout
while wait and wait_timeout > time.time(): while wait and wait_timeout > time.time():
instance_dict_array = []
matched_instances = [] matched_instances = []
for res in ec2.get_all_instances(instance_ids): for res in ec2.get_all_instances(instance_ids):
for i in res.instances: for i in res.instances:
if i.state == state: if i.state == state:
instance_dict_array.append(get_instance_info(i))
matched_instances.append(i) matched_instances.append(i)
if len(matched_instances) < len(instance_ids): if len(matched_instances) < len(instance_ids):
time.sleep(5) time.sleep(5)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment