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

fix KeyError: 'Tags' for ec2_instance #476

Merged
merged 2 commits into from
Mar 14, 2021
Merged

fix KeyError: 'Tags' for ec2_instance #476

merged 2 commits into from
Mar 14, 2021

Conversation

markuman
Copy link
Member

SUMMARY

When you apply ec2_instance on existing ec2 instances that has no tags, ec2_instance throws key errors on 'Tags'.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ec2_instance

ADDITIONAL INFORMATION
  File "/tmp/ansible_community.aws.ec2_instance_payload_tuiv6f2j/ansible_community.aws.ec2_instance_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_instance.py", line 1795, in <module>
  File "/tmp/ansible_community.aws.ec2_instance_payload_tuiv6f2j/ansible_community.aws.ec2_instance_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_instance.py", line 1777, in main
  File "/tmp/ansible_community.aws.ec2_instance_payload_tuiv6f2j/ansible_community.aws.ec2_instance_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_instance.py", line 892, in manage_tags
KeyError: 'Tags'





  File "/tmp/ansible_community.aws.ec2_instance_payload_pgtqeywj/ansible_community.aws.ec2_instance_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_instance.py", line 1795, in <module>
  File "/tmp/ansible_community.aws.ec2_instance_payload_pgtqeywj/ansible_community.aws.ec2_instance_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_instance.py", line 1780, in main
  File "/tmp/ansible_community.aws.ec2_instance_payload_pgtqeywj/ansible_community.aws.ec2_instance_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_instance.py", line 1607, in ensure_present
  File "/tmp/ansible_community.aws.ec2_instance_payload_pgtqeywj/ansible_community.aws.ec2_instance_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_instance.py", line 1598, in handle_existing
  File "/tmp/ansible_community.aws.ec2_instance_payload_pgtqeywj/ansible_community.aws.ec2_instance_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_instance.py", line 1598, in <listcomp>
  File "/tmp/ansible_community.aws.ec2_instance_payload_pgtqeywj/ansible_community.aws.ec2_instance_payload.zip/ansible_collections/community/aws/plugins/modules/ec2_instance.py", line 1562, in pretty_instance
KeyError: 'Tags'

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review module module needs_triage plugins plugin (any type) small_patch Hopefully easy to review traceback needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed community_review labels Mar 13, 2021
@markuman
Copy link
Member Author

recheck

@ansibullbot ansibullbot added community_review and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Mar 13, 2021
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.

LGTM

@tremble
Copy link
Contributor

tremble commented Mar 14, 2021

recheck

@tremble
Copy link
Contributor

tremble commented Mar 14, 2021

We rely on the Name tag for tests, so we can't easily test this in CI, but the existing tests aren't failing. We've a few full test runs currently going through so I'll get this merged once the test queue is cleared.

@tremble tremble merged commit 64eef7a into ansible-collections:main Mar 14, 2021
@tremble
Copy link
Contributor

tremble commented Mar 14, 2021

@markuman,

Thanks for the PR

danquixote pushed a commit to danquixote/community.aws that referenced this pull request May 16, 2021
* fix key error when ec2 instance has no tags
* add changelog fragment
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
* fix key error when ec2 instance has no tags
* add changelog fragment
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request Jul 19, 2021
* fix key error when ec2 instance has no tags
* add changelog fragment
danielcotton pushed a commit to danielcotton/community.aws that referenced this pull request Nov 23, 2021
* fix key error when ec2 instance has no tags
* add changelog fragment
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request May 25, 2022
* fix key error when ec2 instance has no tags
* add changelog fragment
alinabuzachis pushed a commit to alinabuzachis/community.aws that referenced this pull request May 25, 2022
…collections#690)

ec2_vpc_route_table - support associating internet gateways

Depends-On: ansible/ansible-zuul-jobs#1362
Depends-On: ansible/ansible-zuul-jobs#1364
SUMMARY

Update ec2_vpc_route_table to support associating internet gateways per feature request ansible-collections#476
Add integration tests
Fix idempotency issue when associating a subnet with a route table

ISSUE TYPE

Feature Pull Request

COMPONENT NAME
ec2_vpc_route_table

Reviewed-by: Mandar Kulkarni <[email protected]>
Reviewed-by: Joseph Torcasso <None>
Reviewed-by: Abhijeet Kasurde <None>
Reviewed-by: Alina Buzachis <None>
Reviewed-by: None <None>
Reviewed-by: Mike Graves <[email protected]>
Reviewed-by: Mark Chappell <None>
Reviewed-by: Mark Woolley <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug community_review module module plugins plugin (any type) small_patch Hopefully easy to review traceback
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants