-
Notifications
You must be signed in to change notification settings - Fork 343
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
Handle ResourceNotFoundException while iterating certificates #646
Handle ResourceNotFoundException while iterating certificates #646
Conversation
It looks like I have hit another unrelated bug that cause a failure of the integration tests: #647 |
@sebastien-rosset Thank you for taking time to work on this. I have a fix for that bug related to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebastien-rosset Could you please add a changelog fragment for this fix?
Build succeeded (gate pipeline).
|
Backport to stable-3: 💚 backport PR created✅ Backport PR branch: Backported as #657 🤖 @patchback |
Handle ResourceNotFoundException while iterating certificates SUMMARY The module/utils/acm.py was not correctly handling deletion of certificates. While iterating over a list of certificates, the get_certificate function was making API calls to obtain more information about the certificates, but some certificates may be deleted while iterating. Fixes #622 ISSUE TYPE Bugfix Pull Request COMPONENT NAME acm.py ADDITIONAL INFORMATION Wow, it seems many tests are very flaky. I'm attempting to fix an issue in ACM, but problems occur elsewhere. Not to mention I raised this PR to fix #622, which was discovered while working on ansible-collections/community.aws#870. And I discovered other issues as well, and so it looks like it's not possible to make any progress without going down a tree of bug fixes. TypeError: 'NoneType' object is not subscriptable fatal: [testhost]: FAILED! => { "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"<stdin>\", line 121, in <module>\n File \"<stdin>\", line 113, in _ansiballz_main\n File \"<stdin>\", line 61, in invoke_module\n File \"/usr/lib64/python3.8/runpy.py\", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib64/python3.8/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib64/python3.8/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_ec2_vpc_igw_payload_g4o1kl_r/ansible_ec2_vpc_igw_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_igw.py\", line 248, in <module>\n File \"/tmp/ansible_ec2_vpc_igw_payload_g4o1kl_r/ansible_ec2_vpc_igw_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_igw.py\", line 242, in main\n File \"/tmp/ansible_ec2_vpc_igw_payload_g4o1kl_r/ansible_ec2_vpc_igw_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_igw.py\", line 132, in process\n File \"/tmp/ansible_ec2_vpc_igw_payload_g4o1kl_r/ansible_ec2_vpc_igw_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_igw.py\", line 220, in ensure_igw_present\n File \"/tmp/ansible_ec2_vpc_igw_payload_g4o1kl_r/ansible_ec2_vpc_igw_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_igw.py\", line 158, in get_igw_info\nTypeError: 'NoneType' object is not subscriptable\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 } Reviewed-by: Alina Buzachis <None> Reviewed-by: Jill R <None> (cherry picked from commit 4b12454)
…657) [PR #646/4b124547 backport][stable-3] Handle ResourceNotFoundException while iterating certificates This is a backport of PR #646 as merged into main (4b12454). SUMMARY The module/utils/acm.py was not correctly handling deletion of certificates. While iterating over a list of certificates, the get_certificate function was making API calls to obtain more information about the certificates, but some certificates may be deleted while iterating. Fixes #622 ISSUE TYPE Bugfix Pull Request COMPONENT NAME acm.py ADDITIONAL INFORMATION Wow, it seems many tests are very flaky. I'm attempting to fix an issue in ACM, but problems occur elsewhere. Not to mention I raised this PR to fix #622, which was discovered while working on ansible-collections/community.aws#870. And I discovered other issues as well, and so it looks like it's not possible to make any progress without going down a tree of bug fixes. TypeError: 'NoneType' object is not subscriptable fatal: [testhost]: FAILED! => { "changed": false, "module_stderr": "Traceback (most recent call last):\n File \"<stdin>\", line 121, in <module>\n File \"<stdin>\", line 113, in _ansiballz_main\n File \"<stdin>\", line 61, in invoke_module\n File \"/usr/lib64/python3.8/runpy.py\", line 207, in run_module\n return _run_module_code(code, init_globals, run_name, mod_spec)\n File \"/usr/lib64/python3.8/runpy.py\", line 97, in _run_module_code\n _run_code(code, mod_globals, init_globals,\n File \"/usr/lib64/python3.8/runpy.py\", line 87, in _run_code\n exec(code, run_globals)\n File \"/tmp/ansible_ec2_vpc_igw_payload_g4o1kl_r/ansible_ec2_vpc_igw_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_igw.py\", line 248, in <module>\n File \"/tmp/ansible_ec2_vpc_igw_payload_g4o1kl_r/ansible_ec2_vpc_igw_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_igw.py\", line 242, in main\n File \"/tmp/ansible_ec2_vpc_igw_payload_g4o1kl_r/ansible_ec2_vpc_igw_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_igw.py\", line 132, in process\n File \"/tmp/ansible_ec2_vpc_igw_payload_g4o1kl_r/ansible_ec2_vpc_igw_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_igw.py\", line 220, in ensure_igw_present\n File \"/tmp/ansible_ec2_vpc_igw_payload_g4o1kl_r/ansible_ec2_vpc_igw_payload.zip/ansible_collections/amazon/aws/plugins/modules/ec2_vpc_igw.py\", line 158, in get_igw_info\nTypeError: 'NoneType' object is not subscriptable\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1 }
…n group (ansible-collections#646) [Plugin elasticache_info] includes the description of each replication group SUMMARY This pull request add the description of the corresponding Elasticache replication group into each described cache cluster. ISSUE TYPE Feature Pull Request COMPONENT NAME elasticache_info ADDITIONAL INFORMATION Actually the only way to describe Elasticache replication groups with Ansible is to use the dynamic inventory. However, exposing the informations about each replication group could be useful in other contexts. In my case, I am generating a few .env files and I need to include some Elasticache replication group primary endpoint and reader endpoint. Since the elasticache_info plugin already exist and already retrieves the appropriate replication_group_id, I believe that this plugin should also retrieve the replication group description when it exists. OTHER REMARKS CONCERNING THIS PULL REQUEST Each provided description is copy/pasted from the official boto3 documentation which is distributed under an Apache 2.0 licence. I did it for consistency reason between and also because I am not a native speaker. Also the provided description is incomplete : I only documented the fields that I was able to retrieve from my current AWS clusters. Boto3 documentation of the "describe_replication_groups" function : https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/elasticache.html#ElastiCache.Client.describe_replication_groups Moreover this pull request might violates the "integration tests" rule : I didn't find any integration test for the elasticache_info plugin and I don't know why no integration test have been made. Reviewed-by: Mark Chappell <None>
…n group (ansible-collections#646) [Plugin elasticache_info] includes the description of each replication group SUMMARY This pull request add the description of the corresponding Elasticache replication group into each described cache cluster. ISSUE TYPE Feature Pull Request COMPONENT NAME elasticache_info ADDITIONAL INFORMATION Actually the only way to describe Elasticache replication groups with Ansible is to use the dynamic inventory. However, exposing the informations about each replication group could be useful in other contexts. In my case, I am generating a few .env files and I need to include some Elasticache replication group primary endpoint and reader endpoint. Since the elasticache_info plugin already exist and already retrieves the appropriate replication_group_id, I believe that this plugin should also retrieve the replication group description when it exists. OTHER REMARKS CONCERNING THIS PULL REQUEST Each provided description is copy/pasted from the official boto3 documentation which is distributed under an Apache 2.0 licence. I did it for consistency reason between and also because I am not a native speaker. Also the provided description is incomplete : I only documented the fields that I was able to retrieve from my current AWS clusters. Boto3 documentation of the "describe_replication_groups" function : https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/elasticache.html#ElastiCache.Client.describe_replication_groups Moreover this pull request might violates the "integration tests" rule : I didn't find any integration test for the elasticache_info plugin and I don't know why no integration test have been made. Reviewed-by: Mark Chappell <None>
…n group (ansible-collections#646) [Plugin elasticache_info] includes the description of each replication group SUMMARY This pull request add the description of the corresponding Elasticache replication group into each described cache cluster. ISSUE TYPE Feature Pull Request COMPONENT NAME elasticache_info ADDITIONAL INFORMATION Actually the only way to describe Elasticache replication groups with Ansible is to use the dynamic inventory. However, exposing the informations about each replication group could be useful in other contexts. In my case, I am generating a few .env files and I need to include some Elasticache replication group primary endpoint and reader endpoint. Since the elasticache_info plugin already exist and already retrieves the appropriate replication_group_id, I believe that this plugin should also retrieve the replication group description when it exists. OTHER REMARKS CONCERNING THIS PULL REQUEST Each provided description is copy/pasted from the official boto3 documentation which is distributed under an Apache 2.0 licence. I did it for consistency reason between and also because I am not a native speaker. Also the provided description is incomplete : I only documented the fields that I was able to retrieve from my current AWS clusters. Boto3 documentation of the "describe_replication_groups" function : https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/elasticache.html#ElastiCache.Client.describe_replication_groups Moreover this pull request might violates the "integration tests" rule : I didn't find any integration test for the elasticache_info plugin and I don't know why no integration test have been made. Reviewed-by: Mark Chappell <None>
SUMMARY
The module/utils/acm.py was not correctly handling deletion of certificates. While iterating over a list of certificates, the
get_certificate
function was making API calls to obtain more information about the certificates, but some certificates may be deleted while iterating.Fixes #622
ISSUE TYPE
COMPONENT NAME
acm.py
ADDITIONAL INFORMATION
Wow, it seems many tests are very flaky. I'm attempting to fix an issue in ACM, but problems occur elsewhere. Not to mention I raised this PR to fix #622, which was discovered while working on ansible-collections/community.aws#870. And I discovered other issues as well, and so it looks like it's not possible to make any progress without going down a tree of bug fixes.