Extract instance ids from the instance objects returned by boto.

This commit is contained in:
Jake Moshenko 2014-12-16 15:10:50 -05:00
parent 2d7e844753
commit 1d68594dc2

View file

@ -118,12 +118,12 @@ class EC2Executor(BuilderExecutor):
elif len(reservation.instances) != 1:
raise ExecutorException('EC2 started wrong number of instances!')
return reservation.instances[0]
return reservation.instances[0].id
def stop_builder(self, builder_id):
ec2_conn = self._get_conn()
stopped_instances = ec2_conn.stop_instances([builder_id], force=True)
if builder_id not in stopped_instances:
stopped_instance_ids = [si.id for si in ec2_conn.stop_instances([builder_id], force=True)]
if builder_id not in stopped_instance_ids:
raise ExecutorException('Unable to stop instance: %s' % builder_id)
class PopenExecutor(BuilderExecutor):