Commit 57d54c1d by jctanner

Merge pull request #5236 from willthames/ec2_inv_rds_fail_safe

ec2 inventory: Fail EC2 inventory better with restricted EC2 users
parents fd4ae165 e9a0aff7
...@@ -298,9 +298,10 @@ class Ec2Inventory(object): ...@@ -298,9 +298,10 @@ class Ec2Inventory(object):
for instance in instances: for instance in instances:
self.add_rds_instance(instance, region) self.add_rds_instance(instance, region)
except boto.exception.BotoServerError as e: except boto.exception.BotoServerError as e:
print "Looks like AWS RDS is down: " if not e.reason == "Forbidden":
print e print "Looks like AWS RDS is down: "
sys.exit(1) print e
sys.exit(1)
def get_instance(self, region, instance_id): def get_instance(self, region, instance_id):
''' Gets details about a specific instance ''' ''' Gets details about a specific instance '''
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment