This repository has been archived by the owner. It is now read-only.
Permalink
Browse files

Fix negative values

  • Loading branch information...
kyleconroy committed Apr 17, 2012
1 parent 01089f5 commit ecf68c5d095a4f85856e012409e8dde4567376e2
Showing with 2 additions and 1 deletion.
  1. +2 −1 reaper.py
View
@@ -34,7 +34,7 @@ def should_kill(instance):
start = datetime.strptime(instance.launch_time, "%Y-%m-%dT%H:%M:%S.%fZ")
end = datetime.utcnow()
- life = start - end
+ life = end - start
print "Current {}".format(life.total_seconds())
print "Machine {}".format(seconds_from_hours(data['duration']))
@@ -50,6 +50,7 @@ def kill(instance):
conn = boto.connect_ec2()
for reservation in conn.get_all_instances():
for instance in reservation.instances:
+ print "Checking {}".format(instance.id)
if should_kill(instance):
kill(instance)
print "Killing {}".format(instance.id)

0 comments on commit ecf68c5

Please sign in to comment.