~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/devscripts/ec2test/account.py

  • Committer: Curtis Hovey
  • Date: 2011-07-15 15:46:51 UTC
  • mto: This revision was merged to the branch mainline in revision 13449.
  • Revision ID: curtis.hovey@canonical.com-20110715154651-eahw01tqq6z60mnk
Removed code and tools that think windmill is still a test layer.

Show diffs side-by-side

added added

removed removed

Lines of Context:
225
225
 
226
226
        self.log('Using machine image version %d\n' % revision)
227
227
        return images[0]
228
 
 
229
 
    def get_instance(self, instance_id):
230
 
        """Look in all of our reservations for an instance with the given ID.
231
 
 
232
 
        Return the instance object if it exists, None otherwise.
233
 
        """
234
 
        # XXX mars 20090729
235
 
        # This method is needed by the ec2-generate-windmill-image.py script,
236
 
        # so please do not delete it.
237
 
        #
238
 
        # This is a strange object on which to put this method, but I did
239
 
        # not want to break encapsulation around the self.conn attribute.
240
 
 
241
 
        for reservation in self.conn.get_all_instances():
242
 
            # We need to look inside each reservation for the instances
243
 
            # themselves.
244
 
            for instance in reservation.instances:
245
 
                if instance.id == instance_id:
246
 
                    return instance
247
 
        return None