From 933af38bcae9d3d59e7d7482afc03e80f3f17173 Mon Sep 17 00:00:00 2001 From: Kai Schaller Date: Mon, 23 Apr 2012 15:13:14 -0500 Subject: [PATCH] Added exception handling for EC2 snapshot removal. Previously if a snapshot was being used by an AMI an exception would be thrown, halting execution. --- rotatelib.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/rotatelib.py b/rotatelib.py index 0210e95..ce8234f 100644 --- a/rotatelib.py +++ b/rotatelib.py @@ -407,7 +407,10 @@ def remove_items(directory='./', items=None, db=None, s3bucket=None, ec2snapshot elif not db and not s3bucket and ec2snapshots: ec2 = connect_to_ec2(aws_access_key_id, aws_secret_access_key) for item in items: - item.delete() + try: + item.delete() + except Exception, e: + pass else: cur = db.cursor() for item in items: