mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
explain source of EC2 inventory error
https://github.com/ansible/ansible/issues/10840 before RDS: `ERROR: Inventory script (ec2.py) had an execution error: Forbidden` EC2: `ERROR: Inventory script (ec2.py) had an execution error: Error connecting to AWS backend. You are not authorized to perform this operation.` after RDS: `ERROR: Inventory script (ec2.py) had an execution error: ERROR: "Forbidden", while: getting RDS instances` EC2: `ERROR: Inventory script (ec2.py) had an execution error: ERROR: "Error connecting to AWS backend. You are not authorized to perform this operation.", while: getting EC2 instances`
This commit is contained in:
parent
2b723c6130
commit
610223fbf4
1 changed files with 6 additions and 2 deletions
|
@ -406,7 +406,9 @@ class Ec2Inventory(object):
|
||||||
else:
|
else:
|
||||||
backend = 'Eucalyptus' if self.eucalyptus else 'AWS'
|
backend = 'Eucalyptus' if self.eucalyptus else 'AWS'
|
||||||
error = "Error connecting to %s backend.\n%s" % (backend, e.message)
|
error = "Error connecting to %s backend.\n%s" % (backend, e.message)
|
||||||
self.fail_with_error(error)
|
self.fail_with_error(
|
||||||
|
'ERROR: "{error}", while: {err_operation}'.format(
|
||||||
|
error=error, err_operation='getting EC2 instances'))
|
||||||
|
|
||||||
def get_rds_instances_by_region(self, region):
|
def get_rds_instances_by_region(self, region):
|
||||||
''' Makes an AWS API call to the list of RDS instances in a particular
|
''' Makes an AWS API call to the list of RDS instances in a particular
|
||||||
|
@ -425,7 +427,9 @@ class Ec2Inventory(object):
|
||||||
error = self.get_auth_error_message()
|
error = self.get_auth_error_message()
|
||||||
if not e.reason == "Forbidden":
|
if not e.reason == "Forbidden":
|
||||||
error = "Looks like AWS RDS is down:\n%s" % e.message
|
error = "Looks like AWS RDS is down:\n%s" % e.message
|
||||||
self.fail_with_error(error)
|
self.fail_with_error(
|
||||||
|
'ERROR: "{error}", while: {err_operation}'.format(
|
||||||
|
error=error, err_operation='getting RDS instances'))
|
||||||
|
|
||||||
def get_elasticache_clusters_by_region(self, region):
|
def get_elasticache_clusters_by_region(self, region):
|
||||||
''' Makes an AWS API call to the list of ElastiCache clusters (with
|
''' Makes an AWS API call to the list of ElastiCache clusters (with
|
||||||
|
|
Loading…
Reference in a new issue