mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 06:12:51 +00:00
Added better region handling and enabled eu-central-1
Make use of improved connect_to_aws that throws an exception if a region can't be connected to (e.g. eu-central-1 requires boto 2.34 onwards) Add eu-central-1 to the two modules that hardcode their regions Add us-gov-west-1 to ec2_ami_search to match documentation! This pull request makes use of the changes in ansible/ansible#9419
This commit is contained in:
@@ -258,7 +258,7 @@ class ElbManager:
|
||||
try:
|
||||
elb = connect_to_aws(boto.ec2.elb, self.region,
|
||||
**self.aws_connect_params)
|
||||
except boto.exception.NoAuthHandlerFound, e:
|
||||
except (boto.exception.NoAuthHandlerFound, StandardError), e:
|
||||
self.module.fail_json(msg=str(e))
|
||||
|
||||
elbs = elb.get_all_load_balancers()
|
||||
@@ -278,7 +278,7 @@ class ElbManager:
|
||||
try:
|
||||
ec2 = connect_to_aws(boto.ec2, self.region,
|
||||
**self.aws_connect_params)
|
||||
except boto.exception.NoAuthHandlerFound, e:
|
||||
except (boto.exception.NoAuthHandlerFound, StandardError), e:
|
||||
self.module.fail_json(msg=str(e))
|
||||
return ec2.get_only_instances(instance_ids=[self.instance_id])[0]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user