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 AttributeError when running ec2_metadata_facts #1138

Merged

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Oct 7, 2022

SUMMARY

Prior to 5.0.0 we caught "Exception" within fetch, this was limited to json.JSONDecodeError, however it looks like we also needed to catch AttributeError for non-dict JSON

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ec2_metadata_facts

ADDITIONAL INFORMATION

fixes: #1134

@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review has_issue module module needs_triage owner_pr PR created by owner/maintainer plugins plugin (any type) small_patch Hopefully easy to review labels Oct 7, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build failed.

⚠️ ansible-galaxy-importer SKIPPED
build-ansible-collection FAILURE in 5m 21s
⚠️ ansible-test-sanity-aws-ansible-python38 SKIPPED
⚠️ ansible-test-sanity-aws-ansible-2.12-python38 SKIPPED
⚠️ ansible-test-sanity-aws-ansible-2.13-python38 SKIPPED
⚠️ ansible-test-units-amazon-aws-python36 SKIPPED
⚠️ ansible-test-units-amazon-aws-python38 SKIPPED
⚠️ ansible-test-units-amazon-aws-python39 SKIPPED
✔️ cloud-tox-py3 SUCCESS in 3m 10s
✔️ ansible-test-splitter SUCCESS in 2m 36s
⚠️ integration-amazon.aws-1 SKIPPED
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
⚠️ integration-amazon.aws-14 SKIPPED
⚠️ integration-amazon.aws-15 SKIPPED
⚠️ integration-amazon.aws-16 SKIPPED
⚠️ integration-amazon.aws-17 SKIPPED
⚠️ integration-amazon.aws-18 SKIPPED
⚠️ 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
✔️ ansible-test-changelog SUCCESS in 2m 18s

@goneri
Copy link
Member

goneri commented Oct 8, 2022

recheck

@goneri goneri added the mergeit Merge the PR (SoftwareFactory) label Oct 8, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

✔️ ansible-galaxy-importer SUCCESS in 4m 10s
✔️ build-ansible-collection SUCCESS in 6m 18s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 8m 56s
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 12m 31s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 9m 13s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 6m 00s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 7m 47s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 6m 52s
✔️ cloud-tox-py3 SUCCESS in 4m 10s
✔️ ansible-test-splitter SUCCESS in 3m 24s
✔️ integration-amazon.aws-1 SUCCESS in 6m 49s
⚠️ integration-amazon.aws-2 SKIPPED
⚠️ integration-amazon.aws-3 SKIPPED
⚠️ integration-amazon.aws-4 SKIPPED
⚠️ integration-amazon.aws-5 SKIPPED
⚠️ integration-amazon.aws-6 SKIPPED
⚠️ integration-amazon.aws-7 SKIPPED
⚠️ integration-amazon.aws-8 SKIPPED
⚠️ integration-amazon.aws-9 SKIPPED
⚠️ integration-amazon.aws-10 SKIPPED
⚠️ integration-amazon.aws-11 SKIPPED
⚠️ integration-amazon.aws-12 SKIPPED
⚠️ integration-amazon.aws-13 SKIPPED
⚠️ integration-amazon.aws-14 SKIPPED
⚠️ integration-amazon.aws-15 SKIPPED
⚠️ integration-amazon.aws-16 SKIPPED
⚠️ integration-amazon.aws-17 SKIPPED
⚠️ integration-amazon.aws-18 SKIPPED
⚠️ 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
✔️ ansible-test-changelog SUCCESS in 3m 04s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit c269898 into ansible-collections:main Oct 8, 2022
@tremble tremble added the backport-5 PR should be backported to the stable-5 branch label Oct 10, 2022
@patchback
Copy link

patchback bot commented Oct 10, 2022

Backport to stable-5: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-5/c269898a50ade92f7e62607ff9e25c05d7f37ffd/pr-1138

Backported as #1141

🤖 @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 Oct 10, 2022
Fix AttributeError when running ec2_metadata_facts

SUMMARY
Prior to 5.0.0 we caught "Exception" within fetch, this was limited to json.JSONDecodeError, however it looks like we also needed to catch AttributeError for non-dict JSON
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_metadata_facts
ADDITIONAL INFORMATION
fixes: #1134

(cherry picked from commit c269898)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Oct 10, 2022
[PR #1138/c269898a backport][stable-5] Fix AttributeError when running ec2_metadata_facts

This is a backport of PR #1138 as merged into main (c269898).
SUMMARY
Prior to 5.0.0 we caught "Exception" within fetch, this was limited to json.JSONDecodeError, however it looks like we also needed to catch AttributeError for non-dict JSON
ISSUE TYPE

Bugfix Pull Request

COMPONENT NAME
ec2_metadata_facts
ADDITIONAL INFORMATION
fixes: #1134

Reviewed-by: Mark Chappell <None>
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Oct 10, 2022
Enable ec2_metadata integration tests

SUMMARY
Enable ec2_metadata_facts integration tests
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
ec2_metadata_facts
ADDITIONAL INFORMATION
As shown by #1138 we should try to ensure that the integration tests are enabled

Reviewed-by: Alina Buzachis <None>
patchback bot pushed a commit that referenced this pull request Oct 10, 2022
Enable ec2_metadata integration tests

SUMMARY
Enable ec2_metadata_facts integration tests
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
ec2_metadata_facts
ADDITIONAL INFORMATION
As shown by #1138 we should try to ensure that the integration tests are enabled

Reviewed-by: Alina Buzachis <None>
(cherry picked from commit 7b0d964)
tremble pushed a commit that referenced this pull request Oct 11, 2022
Enable ec2_metadata integration tests

SUMMARY
Enable ec2_metadata_facts integration tests
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
ec2_metadata_facts
ADDITIONAL INFORMATION
As shown by #1138 we should try to ensure that the integration tests are enabled

Reviewed-by: Alina Buzachis <None>
(cherry picked from commit 7b0d964)

Co-authored-by: Mark Chappell
@tremble tremble deleted the issues/1134 branch October 21, 2022 07:33
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 has_issue mergeit Merge the PR (SoftwareFactory) module module needs_triage owner_pr PR created by owner/maintainer plugins plugin (any type) small_patch Hopefully easy to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ec2_metadata_facts returns "AttributeError: 'int' object has no attribute 'items'"
3 participants