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

Cleanup - use is_boto3_error_(message|code) #268

Merged
merged 11 commits into from
Feb 5, 2021

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Oct 19, 2020

SUMMARY

Make heavier use of is_boto3_error_code and is_boto3_error_message. This reduces the chances of accidentally dropping exceptions on the floor and makes some of the code paths simpler to follow.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

plugins/modules/aws_elasticbeanstalk_app.py
plugins/modules/aws_glue_connection.py
plugins/modules/aws_glue_job.py
plugins/modules/aws_kms_info.py
plugins/modules/aws_ssm_parameter_store.py
plugins/modules/aws_step_functions_state_machine_execution.py
plugins/modules/aws_waf_condition.py
plugins/modules/cloudfront_invalidation.py
plugins/modules/cloudwatchevent_rule.py
plugins/modules/data_pipeline.py
plugins/modules/ec2_asg.py
plugins/modules/ec2_asg_info.py
plugins/modules/ec2_instance.py
plugins/modules/ec2_placement_group.py
plugins/modules/ec2_transit_gateway_info.py
plugins/modules/ec2_vpc_egress_igw.py
plugins/modules/ec2_vpc_nacl_info.py
plugins/modules/ec2_vpc_route_table.py
plugins/modules/ecs_ecr.py
plugins/modules/ecs_service_info.py
plugins/modules/efs.py
plugins/modules/elasticache.py
plugins/modules/elasticache_info.py
plugins/modules/elasticache_snapshot.py
plugins/modules/elb_target_group.py
plugins/modules/execute_lambda.py
plugins/modules/iam_group.py
plugins/modules/iam_managed_policy.py
plugins/modules/iam_password_policy.py
plugins/modules/iam_policy_info.py
plugins/modules/iam_role.py
plugins/modules/iam_role_info.py
plugins/modules/iam_user.py
plugins/modules/lambda_alias.py
plugins/modules/lambda_facts.py
plugins/modules/lambda_info.py
plugins/modules/lambda_policy.py
plugins/modules/lightsail.py
plugins/modules/rds_instance.py
plugins/modules/rds_param_group.py
plugins/modules/s3_lifecycle.py
plugins/modules/sqs_queue.py

ADDITIONAL INFORMATION

I recommend reviewing the commits separately it's easier to follow what's changing.

@tremble tremble force-pushed the cleanup/is_boto3_error branch 2 times, most recently from b46759e to 3834e9f Compare October 20, 2020 10:43
@tremble tremble force-pushed the cleanup/is_boto3_error branch from 3834e9f to 57cb6f0 Compare November 14, 2020 09:52
@ansibullbot ansibullbot added affects_2.10 feature This issue/PR relates to a feature request module module needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR needs_triage owner_pr PR created by owner/maintainer plugins plugin (any type) labels Nov 16, 2020
@ansibullbot ansibullbot added the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Jan 13, 2021
@tremble tremble force-pushed the cleanup/is_boto3_error branch from 57cb6f0 to 7e186c6 Compare January 15, 2021 14:54
@tremble tremble requested review from jillr and goneri January 15, 2021 15:14
@tremble tremble force-pushed the cleanup/is_boto3_error branch from 7e186c6 to 5cf14de Compare January 27, 2021 10:15
@ansibullbot ansibullbot removed the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Jan 27, 2021
@jillr
Copy link
Collaborator

jillr commented Feb 3, 2021

@tremble I think rebasing and resolving your merge conflict will be needed for the failing tests so I didn't actually rerun them for you today

@ansibullbot ansibullbot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html and removed needs_triage labels Feb 3, 2021
@tremble tremble force-pushed the cleanup/is_boto3_error branch from e8892e5 to 41c7024 Compare February 3, 2021 22:35
@ansibullbot ansibullbot removed the needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html label Feb 3, 2021
@tremble
Copy link
Contributor Author

tremble commented Feb 5, 2021

Shippable tests are passing and @jillr has approved. There are a number of AZP failures, the ones I've looked into are related to resource_prefix being much longer in AZP.

I'm going to merge this and then attack the AZP issues separately.

@tremble tremble merged commit 4cf52ef into ansible-collections:main Feb 5, 2021
@tremble tremble deleted the cleanup/is_boto3_error branch February 11, 2021 09:10
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 16, 2021
…tions#268)

* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@4cf52ef
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations
danielcotton pushed a commit to danielcotton/community.aws that referenced this pull request Nov 23, 2021
* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request May 25, 2022
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request May 25, 2022
* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request May 25, 2022
* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@4cf52ef
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@4cf52ef
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@4cf52ef
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@4cf52ef
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@4cf52ef
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@4cf52ef
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@4cf52ef
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@4cf52ef
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@4cf52ef
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@4cf52ef
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
* Reorder imports
* Make use of is_boto3_error_message
* Mass-migration over to is_boto3_error_code
* Remove unused imports
* unused vars in exception
* Improve consistency around catching BotoCoreError and ClientError
* Remove unused imports
* Remove unused 'PolicyError' from iam_policy_info
* Avoid catching botocore.exceptions.ClientError when we only want some error codes
* Import camel_dict_to_snake_dict/snake_dict_to_camel_dict from ansible.module_utils.common.dict_transformations

This commit was initially merged in https://github.com/ansible-collections/community.aws
See: ansible-collections@4cf52ef
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects_2.10 feature This issue/PR relates to a feature request module module needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR owner_pr PR created by owner/maintainer plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants