mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-07 05:42:50 +00:00
Move profile and region checking to module_utils.ec2 (#31921)
* Move profile and region checking to module_utils.ec2 Remove ProfileNotFound checking from individual modules There are plenty of `if not region:` checks that could be removed, once more thorough testing of this change has occured The ec2_asg, iam_managed_policy and ec2_vpc_subnet_facts modules would also benefit from this change but as they do not have tests and are marked stableinterface, they do not get this change.
This commit is contained in:
committed by
Sloane Hertel
parent
cd80f26035
commit
c93ddf5473
@@ -10,7 +10,7 @@
|
||||
assert:
|
||||
that:
|
||||
- 'result.failed'
|
||||
- 'result.msg.startswith("Region must be specified")'
|
||||
- 'result.msg.startswith("The aws_api_gateway module requires a region")'
|
||||
|
||||
# ============================================================
|
||||
- name: test with minimal parameters but no region
|
||||
@@ -23,7 +23,7 @@
|
||||
assert:
|
||||
that:
|
||||
- 'result.failed'
|
||||
- 'result.msg.startswith("Region must be specified")'
|
||||
- 'result.msg.startswith("The aws_api_gateway module requires a region")'
|
||||
|
||||
# ============================================================
|
||||
- name: test disallow multiple swagger sources
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
assert:
|
||||
that:
|
||||
- 'result.failed'
|
||||
- 'result.msg.startswith("The AWS region must be specified as an environment variable or in the AWS credentials profile")'
|
||||
- 'result.msg.startswith("The ec2_group module requires a region")'
|
||||
|
||||
# ============================================================
|
||||
- name: test valid ec2_url parameter
|
||||
@@ -124,7 +124,7 @@
|
||||
assert:
|
||||
that:
|
||||
- 'result.failed'
|
||||
- 'result.msg.startswith("The AWS region must be specified as an environment variable or in the AWS credentials profile")'
|
||||
- 'result.msg.startswith("The ec2_group module requires a region")'
|
||||
|
||||
# ============================================================
|
||||
- name: test credentials from environment
|
||||
|
||||
Reference in New Issue
Block a user