~kim0/+junk/awstrial-fixes

« back to all changes in this revision

Viewing changes to trial/ec2_helper.py

  • Committer: Scott Moser
  • Date: 2010-10-04 17:32:38 UTC
  • Revision ID: smoser@ubuntu.com-20101004173238-bjuqjt7fsx9s1yze
update terminated_time database for instances missing form aws query results

Show diffs side-by-side

added added

removed removed

Lines of Context:
173
173
 
174
174
    for inst in instances:
175
175
        if inst.instance_id not in aws_ihash:
176
 
            # we really should try to update the instance here also
177
 
            # as it could be we lauched, then never updated until
178
 
            # it was completely gone from the aws side (hours later)
179
 
            continue
 
176
            # update the instance here also as it could be we lauched
 
177
            # then never updated until it was completely gone from the
 
178
            # aws side (hours later)
 
179
            inst.terminated_time = util.dtnow()
 
180
            import sys; sys.stderr.write("instance %s not seen in results, marking as terminated\n", inst.instance_id)
 
181
            inst.save()
180
182
        if update_instance_from_aws(inst,aws_ihash[inst.instance_id]):
181
183
            import sys; sys.stderr.write("saving state of %s\n" % inst.instance_id)
182
184
            inst.save()