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

ec2_metadata_facts - fix AttributeError when running on older managed hosts #1359

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Feb 10, 2023

SUMMARY

Unlike most of our modules, the ec2_metadata_facts is always expected to run on managed hosts, and doesn't depend on the AWS SDKs.

With Python 2.7 support still in place for managed hosts on all supported Ansible versions it makes sense, in the specific case of ec2_metadata_facts, to continue to support Python 2.7 for now.

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

ec2_metadata_facts

ADDITIONAL INFORMATION

fixes: #1358

@tremble tremble marked this pull request as ready for review February 10, 2023 12:47
@tremble tremble added the backport-5 PR should be backported to the stable-5 branch label Feb 10, 2023
@ansibullbot
Copy link

@ansibullbot ansibullbot added bug This issue/PR relates to a bug community_review integration tests/integration module module plugins plugin (any type) tests tests labels Feb 10, 2023
@jillr
Copy link
Collaborator

jillr commented Feb 10, 2023

recheck

1 similar comment
@goneri
Copy link
Member

goneri commented Feb 10, 2023

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/b1990bea0a54414b8009c93837640e19

✔️ ansible-galaxy-importer SUCCESS in 3m 43s
✔️ build-ansible-collection SUCCESS in 14m 00s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 12m 01s (non-voting)
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 14m 31s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 12m 20s
✔️ ansible-test-sanity-aws-ansible-2.14 SUCCESS in 8m 57s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 12m 37s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 7m 50s
ansible-test-units-amazon-aws-python39 RETRY_LIMIT in 16s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 11m 46s
✔️ cloud-tox-py3 SUCCESS in 8m 03s
✔️ ansible-test-changelog SUCCESS in 4m 22s
✔️ ansible-test-splitter SUCCESS in 4m 54s
integration-amazon.aws-1 FAILURE in 14m 07s
Skipped 43 jobs

@tremble
Copy link
Contributor Author

tremble commented Feb 13, 2023

recheck

@softwarefactory-project-zuul
Copy link
Contributor

Build failed.
https://ansible.softwarefactory-project.io/zuul/buildset/dfff4ebbab484d64ba1cd62a0ced9ef6

✔️ ansible-galaxy-importer SUCCESS in 3m 51s
✔️ build-ansible-collection SUCCESS in 12m 53s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 10m 28s (non-voting)
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 13m 24s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 22m 03s
✔️ ansible-test-sanity-aws-ansible-2.14 SUCCESS in 8m 34s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 9m 14s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 9m 35s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 8m 39s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 9m 38s
✔️ cloud-tox-py3 SUCCESS in 6m 53s
✔️ ansible-test-changelog SUCCESS in 4m 17s
✔️ ansible-test-splitter SUCCESS in 5m 18s
integration-amazon.aws-1 FAILURE in 13m 54s
Skipped 43 jobs

@github-actions
Copy link

github-actions bot commented Feb 13, 2023

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
Copy link
Contributor

Build succeeded.
https://ansible.softwarefactory-project.io/zuul/buildset/b15aa945fa0741acb840d2a2fcd7e022

✔️ ansible-galaxy-importer SUCCESS in 4m 07s
✔️ build-ansible-collection SUCCESS in 12m 39s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 9m 53s (non-voting)
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 17m 10s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 8m 27s
✔️ ansible-test-sanity-aws-ansible-2.14 SUCCESS in 16m 11s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 9m 55s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 10m 18s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 8m 56s
✔️ ansible-test-units-amazon-aws-python310 SUCCESS in 8m 43s
✔️ cloud-tox-py3 SUCCESS in 7m 20s
✔️ ansible-test-changelog SUCCESS in 4m 33s
✔️ ansible-test-splitter SUCCESS in 4m 57s
✔️ integration-amazon.aws-1 SUCCESS in 9m 27s
Skipped 43 jobs

@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Feb 13, 2023
@softwarefactory-project-zuul
Copy link
Contributor

Build failed (gate pipeline). For information on how to proceed, see
http://docs.openstack.org/infra/manual/developers.html#automated-testing

https://ansible.softwarefactory-project.io/zuul/buildset/4e00eda350df43f5b1ec823b7a03becc

ansible-galaxy-importer RETRY_LIMIT in 4m 51s
✔️ build-ansible-collection SUCCESS in 12m 33s
✔️ ansible-test-splitter SUCCESS in 4m 48s
integration-amazon.aws-1 RETRY_LIMIT in 1m 30s
Skipped 43 jobs

@tremble
Copy link
Contributor Author

tremble commented Feb 13, 2023

regate

@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).
https://ansible.softwarefactory-project.io/zuul/buildset/b7433c3609674522b9ca2772b2bf3ad8

✔️ ansible-galaxy-importer SUCCESS in 3m 48s
✔️ build-ansible-collection SUCCESS in 14m 56s
✔️ ansible-test-splitter SUCCESS in 5m 04s
✔️ integration-amazon.aws-1 SUCCESS in 10m 49s
Skipped 43 jobs

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 3157004 into ansible-collections:main Feb 13, 2023
@patchback
Copy link

patchback bot commented Feb 13, 2023

Backport to stable-5: 💔 cherry-picking failed — conflicts found

❌ Failed to cleanly apply 3157004 on top of patchback/backports/stable-5/31570048cfbd7fe8d26c7f192b0043609d6ba8bc/pr-1359

Backporting merged PR #1359 into main

  1. Ensure you have a local repo clone of your fork. Unless you cloned it
    from the upstream, this would be your origin remote.
  2. Make sure you have an upstream repo added as a remote too. In these
    instructions you'll refer to it by the name upstream. If you don't
    have it, here's how you can add it:
    $ git remote add upstream https://github.com/ansible-collections/amazon.aws.git
  3. Ensure you have the latest copy of upstream and prepare a branch
    that will hold the backported code:
    $ git fetch upstream
    $ git checkout -b patchback/backports/stable-5/31570048cfbd7fe8d26c7f192b0043609d6ba8bc/pr-1359 upstream/stable-5
  4. Now, cherry-pick PR ec2_metadata_facts - fix AttributeError when running on older managed hosts #1359 contents into that branch:
    $ git cherry-pick -x 31570048cfbd7fe8d26c7f192b0043609d6ba8bc
    If it'll yell at you with something like fatal: Commit 31570048cfbd7fe8d26c7f192b0043609d6ba8bc is a merge but no -m option was given., add -m 1 as follows intead:
    $ git cherry-pick -m1 -x 31570048cfbd7fe8d26c7f192b0043609d6ba8bc
  5. At this point, you'll probably encounter some merge conflicts. You must
    resolve them in to preserve the patch from PR ec2_metadata_facts - fix AttributeError when running on older managed hosts #1359 as close to the
    original as possible.
  6. Push this branch to your fork on GitHub:
    $ git push origin patchback/backports/stable-5/31570048cfbd7fe8d26c7f192b0043609d6ba8bc/pr-1359
  7. Create a PR, ensure that the CI is green. If it's not — update it so that
    the tests and any other checks pass. This is it!
    Now relax and wait for the maintainers to process your pull request
    when they have some cycles to do reviews. Don't worry — they'll tell you if
    any improvements are necessary when the time comes!

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

@tremble tremble deleted the ec2_metadata_facts/py27 branch February 15, 2023 09:04
tremble added a commit to tremble/amazon.aws that referenced this pull request Mar 9, 2023
…ta_facts - fix AttributeError when running on older managed hosts

ec2_metadata_facts - fix AttributeError when running on older managed hosts

##### SUMMARY
Unlike most of our modules, the ec2_metadata_facts is always expected to run on managed hosts, and doesn't depend on the AWS SDKs.
With Python 2.7 support still in place for managed hosts on all supported Ansible versions it makes sense, in the specific case of ec2_metadata_facts, to continue to support Python 2.7 for now.

##### ISSUE TYPE

Bugfix Pull Request

##### COMPONENT NAME
ec2_metadata_facts

##### ADDITIONAL INFORMATION
fixes: ansible-collections#1358
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Mar 19, 2023
…ibuteError when running on older managed hosts (#1420)

[PR #1359/31570048 backport] [stable-5] ec2_metadata_facts - fix AttributeError when running on older managed hosts

This is a MANUAL backport of PR #1359 as merged into main (3157004).
SUMMARY
Unlike most of our modules, the ec2_metadata_facts is always expected to run on managed hosts, and doesn't depend on the AWS SDKs. With Python 2.7 support still in place for managed hosts on all supported Ansible versions it makes sense, in the specific case of ec2_metadata_facts, to continue to support Python 2.7 for now.
ISSUE TYPE
Bugfix Pull Request
COMPONENT NAME
ec2_metadata_facts
ADDITIONAL INFORMATION
fixes: #1358
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Oct 24, 2023
…e-collections#1359)

Attempt to sync README.md docs with amazon.aws where possible

SUMMARY
Minor drift has occurred between the amazon.aws and community.aws docs.  Attempt to re-synchronise where appropriate
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
README.md
ADDITIONAL INFORMATION
See also : ansible-collections#937

Reviewed-by: Joseph Torcasso <None>
Reviewed-by: Alina Buzachis <None>
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 integration tests/integration mergeit Merge the PR (SoftwareFactory) module module plugins plugin (any type) tests tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AttributeError: 'module' object has no attribute 'JSONDecodeError'
6 participants