1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fail EC2 inventory better with restricted EC2 users

If a user has full EC2 access but no RDS access, the user
should still be able to query the EC2 inventory, although
will not obtain any information about any RDS instances.
This commit is contained in:
Will Thames 2013-12-10 21:32:54 +10:00
parent 5cd97e8cf6
commit e9a0aff77c

View file

@ -295,9 +295,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 '''