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

Add ResourceType on ec2 snapshot copy #1419

Merged
merged 2 commits into from
Nov 25, 2022
Merged

Add ResourceType on ec2 snapshot copy #1419

merged 2 commits into from
Nov 25, 2022

Conversation

bplaxco
Copy link
Contributor

@bplaxco bplaxco commented Aug 24, 2022

SUMMARY

Fixes this issue that shows up when tags are specified:

An error occurred waiting for the snapshot to become available.: An
error occurred (InvalidParameterValue) when calling the CopySnapshot
operation: Tag specification resource type must have a value
ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ec2_snapshot_copy

ADDITIONAL INFORMATION
# before

botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the CopySnapshot operation: Tag specification resource type must have a value                              
fatal: [localhost]: FAILED! => {                                                                                                                                                                   
    "boto3_version": "1.24.57",                                                                                                                                                                    
    "botocore_version": "1.27.58",                                                                                                                                                                 
    "changed": false,                                                                                                                                                                              
    "error": {                                                                                                                                                                                     
        "code": "InvalidParameterValue",                                                                                                                                                           
        "message": "Tag specification resource type must have a value"                                                                                                                             
    },  
....


# after  (no error message)

changed: [localhost] => {                                                                                                                                                                          
    "changed": true,                                                                                                                                                                               
    "invocation": {                                                                                                                                                                                
        "module_args": {       
.....

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review module module needs_triage new_contributor Help guide this first time contributor plugins plugin (any type) small_patch Hopefully easy to review labels Aug 24, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

✔️ ansible-galaxy-importer SUCCESS in 3m 31s
✔️ build-ansible-collection SUCCESS in 5m 13s
✔️ ansible-test-sanity-docker-devel SUCCESS in 9m 00s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 17s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 44s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 9m 04s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 6m 59s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 6m 08s
✔️ ansible-test-splitter SUCCESS in 2m 34s
⚠️ integration-community.aws-1 SKIPPED
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

Copy link
Contributor

@tremble tremble left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @bplaxco,

Thanks for taking the time to submit this PR. The change itself looks correct, however I'd ask for two minor additions:

  1. Please add a changelog fragment: https://docs.ansible.com/ansible/latest/community/development_process.html#changelogs-how-to
  2. (optional) It would be really good if you could add an integration test. These are (in essence) just an an Ansible role which try to systematically exercise the module to test it behaves as expected, and live in tests/integration/targets/. A good starting point might be https://github.com/ansible-collections/amazon.aws/tree/main/tests/integration/targets/ec2_snapshot from the amazon.aws collection

@ansibullbot ansibullbot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed community_review labels Aug 31, 2022
@bplaxco
Copy link
Contributor Author

bplaxco commented Sep 2, 2022

Changelog fragment added.

Looking into the tests.

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

✔️ ansible-galaxy-importer SUCCESS in 4m 11s
✔️ build-ansible-collection SUCCESS in 4m 57s
✔️ ansible-test-sanity-docker-devel SUCCESS in 10m 12s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 19s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 11m 12s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 10m 19s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 6m 31s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 5m 38s
✔️ ansible-test-splitter SUCCESS in 2m 45s
⚠️ integration-community.aws-1 SKIPPED
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@ansibullbot ansibullbot added community_review integration tests/integration tests tests and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR small_patch Hopefully easy to review labels Sep 2, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

✔️ ansible-galaxy-importer SUCCESS in 4m 12s
✔️ build-ansible-collection SUCCESS in 4m 57s
✔️ ansible-test-sanity-docker-devel SUCCESS in 9m 43s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 11m 56s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 11m 59s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 11m 02s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 6m 42s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 6m 57s
✔️ ansible-test-splitter SUCCESS in 2m 34s
integration-community.aws-1 FAILURE in 6m 03s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

✔️ ansible-galaxy-importer SUCCESS in 4m 08s
✔️ build-ansible-collection SUCCESS in 5m 30s
✔️ ansible-test-sanity-docker-devel SUCCESS in 10m 25s (non-voting)
✔️ ansible-test-sanity-docker-milestone SUCCESS in 10m 30s
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 48s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 10m 18s
✔️ ansible-test-units-community-aws-python38 SUCCESS in 5m 54s
✔️ ansible-test-units-community-aws-python39 SUCCESS in 6m 20s
✔️ ansible-test-splitter SUCCESS in 2m 29s
integration-community.aws-1 FAILURE in 6m 40s
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED

@bplaxco
Copy link
Contributor Author

bplaxco commented Sep 2, 2022

@tremble in the zuul ouput I get:

    "error": {
        "code": "UnauthorizedOperation",
        "message": "You are not authorized to perform this operation. Encoded authorization failure message: SZOho26QkeN31KcOxBTUnC_sBSeRa3G9qqAmqJOLtkkAiUvLcOIlJVojSNLkyZa7MXEHWbTOAtc5aemsWR_tKiqEZtwr5OlwXk4PbtKTtj0NdpDaBeDs1q-Mpt7zDktDjJmk41tSPe-Rjjqe1ftFJhuZ76rQKHOXEeLol1QsaW2kA9x74EEf6gbr13kMUi2CyF3D-XTFMLkpZj-XShxzE9QbF1xvmnvwxIbmwuVk0PWFUX8dKbQbeB4K_jSCBLIV5Ag3Rio0Foc4h6uYfBmTz_vOR7J2ukyrRdgn5dwIc_78jFpa2DSqPa93EbGXeXjW6fTtzFvsExeRynD7-QBDY4iZEYGE2inBGZHZO7elmhh4Ie9G-xV6g2hBZVlWShrDzxGoJjanOiqTxl3530TxVRO-YO3kIzDbG55DouvtyOGdJyQntxyeIB2eR0gZhI5maCAcsD2YODtRyhwIDIXhGiBKmB4GmZ90ZgfQ0zHkLf4aLr5xxZcpeqf3juVUpMUMdOIWQ_VIdldVmPvx13e4FrsVACt4509Uh1vt5R7N-vX6YSh5g9CDrJ8"
    }

The module args passed in to ec2_snapshot_copy seem legit from what I know about the module, would someone be able to take a look and confirm the service account used has the right permissions? Or would you rather me mark the tests as disabled or something like that?

Copy link

@colbyshores colbyshores left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change on line 141 to declare type ['snapshot'] in ec2_snapshot_copy.py looks good to me

Fixes this issue that shows up when tags are specified:

An error occurred waiting for the snapshot to become available.: An
error occurred (InvalidParameterValue) when calling the CopySnapshot
operation: Tag specification resource type must have a value

~ B'ezrat Hashem ~
The new tests seem to be failing due to a permissions issue with the
service account used to run them. Since they were marked as optional
in the MR I'm going to remove them but leave them in the history[1] so
the work's not lost in case someone wants to use them.

[1] The tests are still on aec7b2f
@bplaxco
Copy link
Contributor Author

bplaxco commented Sep 14, 2022

@tremble

I went ahead and removed the tests to get the MR through since they were marked as optional, but since they seemed to be failing because of a permission issue with the service account running them, I kept them in the history[1] in case we want to pull them back in.

Feel free to ping me on gchat at work if you'd like to sync up on getting the test running ^_^

[1] The tests are still on aec7b2f

@softwarefactory-project-zuul
Copy link
Contributor

@bplaxco
Copy link
Contributor Author

bplaxco commented Nov 8, 2022

Hey @tremble just wanted to see if you need anything else from me on this ^_^

@tremble
Copy link
Contributor

tremble commented Nov 25, 2022

@bplaxco sorry about the delay here. LGTM

@tremble tremble added mergeit Merge the PR (SoftwareFactory) backport-5 PR should be backported to the stable-5 branch labels Nov 25, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

✔️ ansible-galaxy-importer SUCCESS in 3m 59s
✔️ build-ansible-collection SUCCESS in 5m 27s
✔️ ansible-test-sanity-docker-devel SUCCESS in 9m 51s (non-voting)
ansible-test-sanity-docker-milestone FAILURE in 8m 13s (non-voting)
✔️ ansible-test-sanity-docker-stable-2.12 SUCCESS in 10m 09s
✔️ ansible-test-sanity-docker-stable-2.13 SUCCESS in 10m 04s
✔️ ansible-test-sanity-docker-stable-2.14 SUCCESS in 9m 34s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 6m 04s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 5m 48s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 5m 55s
✔️ ansible-test-changelog SUCCESS in 2m 09s
✔️ ansible-test-splitter SUCCESS in 2m 59s
⚠️ integration-community.aws-1 SKIPPED
⚠️ integration-community.aws-2 SKIPPED
⚠️ integration-community.aws-3 SKIPPED
⚠️ integration-community.aws-4 SKIPPED
⚠️ integration-community.aws-5 SKIPPED
⚠️ integration-community.aws-6 SKIPPED
⚠️ integration-community.aws-7 SKIPPED
⚠️ integration-community.aws-8 SKIPPED
⚠️ integration-community.aws-9 SKIPPED
⚠️ integration-community.aws-10 SKIPPED
⚠️ integration-community.aws-11 SKIPPED
⚠️ integration-community.aws-12 SKIPPED
⚠️ integration-community.aws-13 SKIPPED
⚠️ integration-community.aws-14 SKIPPED
⚠️ integration-community.aws-15 SKIPPED
⚠️ integration-community.aws-16 SKIPPED
⚠️ integration-community.aws-17 SKIPPED
⚠️ integration-community.aws-18 SKIPPED
⚠️ integration-community.aws-19 SKIPPED
⚠️ integration-community.aws-20 SKIPPED
⚠️ integration-community.aws-21 SKIPPED
⚠️ integration-community.aws-22 SKIPPED

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit fad3589 into ansible-collections:main Nov 25, 2022
@patchback
Copy link

patchback bot commented Nov 25, 2022

Backport to stable-5: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-5/fad358924d91150b6278a7832c2f2028d588bd44/pr-1419

Backported as #1605

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

patchback bot pushed a commit that referenced this pull request Nov 25, 2022
Add ResourceType on ec2 snapshot copy

SUMMARY
Fixes this issue that shows up when tags are specified:
An error occurred waiting for the snapshot to become available.: An
error occurred (InvalidParameterValue) when calling the CopySnapshot
operation: Tag specification resource type must have a value

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_snapshot_copy
ADDITIONAL INFORMATION

# before

botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the CopySnapshot operation: Tag specification resource type must have a value
fatal: [localhost]: FAILED! => {
    "boto3_version": "1.24.57",
    "botocore_version": "1.27.58",
    "changed": false,
    "error": {
        "code": "InvalidParameterValue",
        "message": "Tag specification resource type must have a value"
    },
....

# after  (no error message)

changed: [localhost] => {
    "changed": true,
    "invocation": {
        "module_args": {
.....

Reviewed-by: Mark Chappell <None>
Reviewed-by: Colby Shores <[email protected]>
Reviewed-by: None <None>
(cherry picked from commit fad3589)
@github-actions
Copy link

Docs Build 📝

Thank you for contribution!✨

This PR has been merged and your docs changes will be incorporated when they are next published.

softwarefactory-project-zuul bot pushed a commit that referenced this pull request Nov 25, 2022
[PR #1419/fad35892 backport][stable-5] Add ResourceType on ec2 snapshot copy

This is a backport of PR #1419 as merged into main (fad3589).
SUMMARY
Fixes this issue that shows up when tags are specified:
An error occurred waiting for the snapshot to become available.: An
error occurred (InvalidParameterValue) when calling the CopySnapshot
operation: Tag specification resource type must have a value

ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_snapshot_copy
ADDITIONAL INFORMATION



# before

botocore.exceptions.ClientError: An error occurred (InvalidParameterValue) when calling the CopySnapshot operation: Tag specification resource type must have a value                              
fatal: [localhost]: FAILED! => {                                                                                                                                                                   
    "boto3_version": "1.24.57",                                                                                                                                                                    
    "botocore_version": "1.27.58",                                                                                                                                                                 
    "changed": false,                                                                                                                                                                              
    "error": {                                                                                                                                                                                     
        "code": "InvalidParameterValue",                                                                                                                                                           
        "message": "Tag specification resource type must have a value"                                                                                                                             
    },  
....


# after  (no error message)

changed: [localhost] => {                                                                                                                                                                          
    "changed": true,                                                                                                                                                                               
    "invocation": {                                                                                                                                                                                
        "module_args": {       
.....

Reviewed-by: Mark Chappell <None>
abikouo pushed a commit to abikouo/community.aws that referenced this pull request Oct 24, 2023
…llections#1419)

route53_info: fix "key error" for health_check operations

SUMMARY

Fixes ansible-collections#1396
This pull request

Add new return key health_check_observations for health check operations, returned when I(query=health_check) and I(health_check_method=status) or I(health_check_method=failure_reason)
Fixes "Key Error" when getting status or failure_reason of a health check.


ISSUE TYPE


Bugfix Pull Request

COMPONENT NAME

route53_info
ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell
Reviewed-by: Mandar Kulkarni <[email protected]>
Reviewed-by: Alina Buzachis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-5 PR should be backported to the stable-5 branch bug This issue/PR relates to a bug community_review integration tests/integration mergeit Merge the PR (SoftwareFactory) module module new_contributor Help guide this first time contributor plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants