Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DNM Migrate ec2_vpc_nat_gateway* modules and tests #5

Closed
wants to merge 29 commits into from

Conversation

alinabuzachis
Copy link
Owner

Migrate ec2_vpc_nat_gateway* modules and tests

jillr and others added 29 commits July 20, 2021 10:54
* Rename core collection

Rename references to ansible.amazon to amazon.aws.

* Rename community.amazon to community.aws
Fix pep8 line lengths for rewritten amazon.aws imports

* Missed a path in shippable.sh
* Dependency repos moved

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@235c5db
* Remove ANSIBLE_METADATA entirely, see ansible/ansible/pull/69454.
Remove `license` field from galaxy.yml, in favor of `license_file`.

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@05672a6
* Update module deprecations

Switch version to `removed_at_date`

* Don't install amazon.aws from galaxy

We've been using galaxy to install amazon.aws in shippable, but that
doesn't really work if we aren't publising faster. Get that collection
from git so it is most up to date.

* We need to declare python test deps now

* missed a python dep

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@7cd211e
* Update docs

Remove .git from repo url so links in readme will generate correctly
Add required ansible version
Run latest version of add_docs.py
Add version_added string to modules

* galaxy.yml was missing authors

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@96ee268
* Update comments to reference AnsibleAWSModule rather than AnsibleModule
* Bulk re-order imports and split onto one from import per-line.
* Add AnsibleAWSModule imports
* Migrate boto 2 based modules to AnsibleAWSModule
* Move boto3-only modules over to AnsibleAWSModule
* Remove extra ec2_argument_spec calls - not needed now we're using AnsibleAWSModule
* Remove most HAS_BOTO3 code, it's handled by AnsibleAWSModule
* Handle missing Boto 2 consistently  (HAS_BOTO)
* Remove AnsibleModule imports
* Changelog fragment

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@818c6d2
…r(e) or e.me… (ansible-collections#26)

* Py3 compat error handling: use to_native(e) instead of str(e) or e.message
* PR comment changes, use fail_json_aws and is_boto3_error_code

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@ffe14f9
…ollections#188)

* Migrate from boto3_conn to module.client
* Simplify error handling when creating connections
* Simplify Region handling
* Remove unused imports
* Changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@6bdf00d
…lections#345) (ansible-collections#372)

* implement tags feature for NAT gateway
 * add integration test tasks for tags feature
 * refactor integration tests (overall) removing hard-coded parameters
 * add missing integration test tasks without CHECK_MODE
 * include until loop for some tasks as they failed during the integration

 * added code to support tags in ec2_vap_nat_gateway - return error 'NoneType' object has no attribute 'get' because of curr_tags seems to remain None
 * removed tests in check_mode because not working due to DRY_RUN_GATEWAY
 * Addressed reviewers comments

Signed-off-by: Alina Buzachis <[email protected]>

Co-authored-by: Alina Buzachis <[email protected]>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@b7afd18
* Remove ec2_vpc_nat_gateway unit tests
* update comments in ec2_vpc_nat_gateway integration tests - they're not based on the hard coded check_mode results any more

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@701153a
* attempt to add more information when failures occur
* Use pagination and add more retry wrappers
* Mark ec2_vpc_nat_gateway stable again.  Using paginator and retries seems to have fixed things
* Add changelog

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@38be7f9
…lections#387)

* NAT gateway: increase integration tests coverage
     * Add additional integration tests for ec2_vpc_nat_gateway_info and ec2_vpc_nat_gatewy modules
     * Add ec2_vpc_nat_gateway_info in aliases
     * Fix NAT gateway search

Signed-off-by: Alina Buzachis <[email protected]>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@fbfc351
* Solve RequestLimitExceeded error by adding the retry decorator

Signed-off-by: Alina Buzachis <[email protected]>

Co-authored-by: Alina Buzachis <[email protected]>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@52fb230
* ec2_vpc_nat_gateway: fix broken check_mode
     * fix broken check_mode (remove hard coded values)
Signed-off-by: Alina Buzachis <[email protected]>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@044b30c
* Add no_log=False to mark some more false-positives of the no_log check.

* More false-positives confirmed by tremble.

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@67b6d75
* ec2_vpc_nat_gateway overall cleanup
   * use custm waiters to manage NAT gateway states (deleted and available)
   * imporve error handling
   * improve documentation examples
   * code cleaning

Signed-off-by: Alina Buzachis <[email protected]>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@9b60a2d
* ec2_vpc_nat_gateway_info: stability
	* Catches and handles (botocore.exceptions.BotoCoreError, botocore.exceptions.ClientError) on boto API calls
	* Add paginator
	* Document returned data

Signed-off-by: Alina Buzachis <[email protected]>

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@b0f438b
This collection has been operating on Zuul CI for some weeks now

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@4e0d83c
@alinabuzachis alinabuzachis force-pushed the promote_ec2_vpc_nat_gateway branch from 6973492 to 69464a5 Compare July 20, 2021 08:54
@alinabuzachis alinabuzachis deleted the promote_ec2_vpc_nat_gateway branch July 20, 2021 09:37
alinabuzachis pushed a commit that referenced this pull request Sep 16, 2022
* Bomb out early if someone tries to set tags without the necessary botocore version

* Simplify some error handling by using fail_json_aws

* Use BotoCoreError rather than the sub-errors

We still bomb out, but fail_json_aws is more graceful and user friendly
than an uncaught Boto3 error.

* use is_boto3_error_code to limit what we catch rather than catching and re-raising.

* Cleanup get_account_info
- use module.client to avoid the mass of extra args
- use is_boto3_error_code('AccessDenied') to be a little cleaner
- fix text search (re.search(, mystring) rather than mystring.search())

* Use module.client helpers

* Delete dead code path - we test for having *both* vpc_subnet_ids and vpc_security_group_ids when we parse the arguments

* Enable basic AWS Retries

* Tweak integration test to allow for common 'missing region' error message

* Rename lambda tests from 'aws_lambda' to 'lambda' (matching the module name)

* Use omit rather than 'null' in the tests - ansible/ansible#69190

* Ignore duplicate-except warnings (it's caused by the way is_boto3_error works)

* change expected error messages now we're using an AnsibleAWSModule feature

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d4e4d3e
alinabuzachis pushed a commit that referenced this pull request Sep 16, 2022
* Bomb out early if someone tries to set tags without the necessary botocore version

* Simplify some error handling by using fail_json_aws

* Use BotoCoreError rather than the sub-errors

We still bomb out, but fail_json_aws is more graceful and user friendly
than an uncaught Boto3 error.

* use is_boto3_error_code to limit what we catch rather than catching and re-raising.

* Cleanup get_account_info
- use module.client to avoid the mass of extra args
- use is_boto3_error_code('AccessDenied') to be a little cleaner
- fix text search (re.search(, mystring) rather than mystring.search())

* Use module.client helpers

* Delete dead code path - we test for having *both* vpc_subnet_ids and vpc_security_group_ids when we parse the arguments

* Enable basic AWS Retries

* Tweak integration test to allow for common 'missing region' error message

* Rename lambda tests from 'aws_lambda' to 'lambda' (matching the module name)

* Use omit rather than 'null' in the tests - ansible/ansible#69190

* Ignore duplicate-except warnings (it's caused by the way is_boto3_error works)

* change expected error messages now we're using an AnsibleAWSModule feature

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d4e4d3e
goneri pushed a commit that referenced this pull request Sep 21, 2022
* Bomb out early if someone tries to set tags without the necessary botocore version

* Simplify some error handling by using fail_json_aws

* Use BotoCoreError rather than the sub-errors

We still bomb out, but fail_json_aws is more graceful and user friendly
than an uncaught Boto3 error.

* use is_boto3_error_code to limit what we catch rather than catching and re-raising.

* Cleanup get_account_info
- use module.client to avoid the mass of extra args
- use is_boto3_error_code('AccessDenied') to be a little cleaner
- fix text search (re.search(, mystring) rather than mystring.search())

* Use module.client helpers

* Delete dead code path - we test for having *both* vpc_subnet_ids and vpc_security_group_ids when we parse the arguments

* Enable basic AWS Retries

* Tweak integration test to allow for common 'missing region' error message

* Rename lambda tests from 'aws_lambda' to 'lambda' (matching the module name)

* Use omit rather than 'null' in the tests - ansible/ansible#69190

* Ignore duplicate-except warnings (it's caused by the way is_boto3_error works)

* change expected error messages now we're using an AnsibleAWSModule feature

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d4e4d3e
goneri pushed a commit that referenced this pull request Sep 21, 2022
* Bomb out early if someone tries to set tags without the necessary botocore version

* Simplify some error handling by using fail_json_aws

* Use BotoCoreError rather than the sub-errors

We still bomb out, but fail_json_aws is more graceful and user friendly
than an uncaught Boto3 error.

* use is_boto3_error_code to limit what we catch rather than catching and re-raising.

* Cleanup get_account_info
- use module.client to avoid the mass of extra args
- use is_boto3_error_code('AccessDenied') to be a little cleaner
- fix text search (re.search(, mystring) rather than mystring.search())

* Use module.client helpers

* Delete dead code path - we test for having *both* vpc_subnet_ids and vpc_security_group_ids when we parse the arguments

* Enable basic AWS Retries

* Tweak integration test to allow for common 'missing region' error message

* Rename lambda tests from 'aws_lambda' to 'lambda' (matching the module name)

* Use omit rather than 'null' in the tests - ansible/ansible#69190

* Ignore duplicate-except warnings (it's caused by the way is_boto3_error works)

* change expected error messages now we're using an AnsibleAWSModule feature

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d4e4d3e
goneri pushed a commit that referenced this pull request Sep 21, 2022
* Bomb out early if someone tries to set tags without the necessary botocore version

* Simplify some error handling by using fail_json_aws

* Use BotoCoreError rather than the sub-errors

We still bomb out, but fail_json_aws is more graceful and user friendly
than an uncaught Boto3 error.

* use is_boto3_error_code to limit what we catch rather than catching and re-raising.

* Cleanup get_account_info
- use module.client to avoid the mass of extra args
- use is_boto3_error_code('AccessDenied') to be a little cleaner
- fix text search (re.search(, mystring) rather than mystring.search())

* Use module.client helpers

* Delete dead code path - we test for having *both* vpc_subnet_ids and vpc_security_group_ids when we parse the arguments

* Enable basic AWS Retries

* Tweak integration test to allow for common 'missing region' error message

* Rename lambda tests from 'aws_lambda' to 'lambda' (matching the module name)

* Use omit rather than 'null' in the tests - ansible/ansible#69190

* Ignore duplicate-except warnings (it's caused by the way is_boto3_error works)

* change expected error messages now we're using an AnsibleAWSModule feature

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections/community.aws@d4e4d3e
alinabuzachis added a commit that referenced this pull request Jul 2, 2024
…ts (ansible-collections#2087)

SUMMARY

Ensures the modules documentation follows the correct formats

ISSUE TYPE


Bugfix Pull Request
Docs Pull Request
Feature Pull Request
New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Mandar Kulkarni <[email protected]>
Reviewed-by: Helen Bailey <[email protected]>
Reviewed-by: GomathiselviS
Reviewed-by: Alina Buzachis
alinabuzachis pushed a commit that referenced this pull request Sep 2, 2024
…ts (ansible-collections#2087) (ansible-collections#2242)

This is a backport of PR ansible-collections#2087 as merged into main (7a487f5).
SUMMARY

Ensures the modules documentation follows the correct formats

ISSUE TYPE


Bugfix Pull Request
Docs Pull Request
Feature Pull Request
New Module Pull Request

COMPONENT NAME

ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants