From 1d68594dc220d5cc16dda89aa5cad62d969210e6 Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Tue, 16 Dec 2014 15:10:50 -0500 Subject: [PATCH] Extract instance ids from the instance objects returned by boto. --- buildman/manager/executor.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/buildman/manager/executor.py b/buildman/manager/executor.py index a3cd4981b..e82ecf672 100644 --- a/buildman/manager/executor.py +++ b/buildman/manager/executor.py @@ -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):