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

Refacterization of code to use 'fallback' instead of using os.environ #1174

Conversation

tremble
Copy link
Contributor

@tremble tremble commented Oct 17, 2022

SUMMARY

When the "ec2" module was first added, it included support for pulling credentials out of the environment variables. 3.5 years later, in Ansible 2.1, support for configuring a 'fallback' directly in the argument specification was added, but we never got around to using it.

This PR finally cleans up the code and lets the argument parser directly handle fallback to environment variables.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

plugins/module_utils/botocore.py
plugins/module_utils/modules.py

ADDITIONAL INFORMATION

@github-actions
Copy link

github-actions bot commented Oct 17, 2022

Docs Build 📝

Thank you for contribution!✨

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

@ansibullbot ansibullbot added community_review feature This issue/PR relates to a feature request module_utils module_utils needs_triage plugins plugin (any type) labels Oct 17, 2022
@softwarefactory-project-zuul

This comment was marked as resolved.

@tremble tremble force-pushed the refacter/connection-fallback branch from e476f66 to 93e73a1 Compare October 17, 2022 12:52
@softwarefactory-project-zuul

This comment was marked as resolved.

@tremble tremble force-pushed the refacter/connection-fallback branch from 93e73a1 to 0bd1b85 Compare October 17, 2022 13:22
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded.

✔️ ansible-galaxy-importer SUCCESS in 4m 26s
✔️ build-ansible-collection SUCCESS in 5m 18s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 10m 04s
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 8m 57s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 9m 17s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 7m 05s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 6m 35s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 6m 46s
✔️ cloud-tox-py3 SUCCESS in 3m 34s
✔️ ansible-test-splitter SUCCESS in 2m 36s
✔️ integration-amazon.aws-1 SUCCESS in 7m 43s
⚠️ 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 SUCCESS in 6m 57s
✔️ integration-community.aws-2 SUCCESS in 22m 42s
⚠️ 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 30s

@tremble tremble marked this pull request as ready for review October 17, 2022 14:31
@tremble tremble added the mergeit Merge the PR (SoftwareFactory) label Oct 17, 2022
@softwarefactory-project-zuul
Copy link
Contributor

Build succeeded (gate pipeline).

✔️ ansible-galaxy-importer SUCCESS in 4m 14s
✔️ build-ansible-collection SUCCESS in 5m 01s
✔️ ansible-test-sanity-aws-ansible-python38 SUCCESS in 9m 01s
✔️ ansible-test-sanity-aws-ansible-2.12-python38 SUCCESS in 9m 40s
✔️ ansible-test-sanity-aws-ansible-2.13-python38 SUCCESS in 9m 29s
✔️ ansible-test-units-amazon-aws-python36 SUCCESS in 7m 36s
✔️ ansible-test-units-amazon-aws-python38 SUCCESS in 6m 17s
✔️ ansible-test-units-amazon-aws-python39 SUCCESS in 6m 29s
✔️ cloud-tox-py3 SUCCESS in 3m 38s
✔️ ansible-test-splitter SUCCESS in 3m 30s
✔️ integration-amazon.aws-1 SUCCESS in 7m 04s
⚠️ 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 SUCCESS in 5m 58s
✔️ integration-community.aws-2 SUCCESS in 23m 18s
⚠️ 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 26s

@softwarefactory-project-zuul softwarefactory-project-zuul bot merged commit 9401932 into ansible-collections:main Oct 17, 2022
@tremble tremble deleted the refacter/connection-fallback branch October 21, 2022 07:32
@tremble tremble added the backport-5 PR should be backported to the stable-5 branch label Oct 29, 2022
@patchback
Copy link

patchback bot commented Oct 29, 2022

Backport to stable-5: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-5/9401932f98ef7c6bc412be0487c8e8c054f934eb/pr-1174

Backported as #1224

🤖 @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 29, 2022
…#1174)

Refacterization of code to use 'fallback' instead of using os.environ

SUMMARY
When the "ec2" module was first added, it included support for pulling credentials out of the environment variables.  3.5 years later, in Ansible 2.1, support for configuring a 'fallback' directly in the argument specification was added, but we never got around to using it.
This PR finally cleans up the code and lets the argument parser directly handle fallback to environment variables.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/module_utils/botocore.py
plugins/module_utils/modules.py
ADDITIONAL INFORMATION

Reviewed-by: Gonéri Le Bouder <goneri@lebouder.net>
(cherry picked from commit 9401932)
softwarefactory-project-zuul bot pushed a commit that referenced this pull request Nov 1, 2022
…#1174) (#1224)

[PR #1174/9401932f backport][stable-5] Refacterization of code to use 'fallback' instead of using os.environ

This is a backport of PR #1174 as merged into main (9401932).
SUMMARY
When the "ec2" module was first added, it included support for pulling credentials out of the environment variables.  3.5 years later, in Ansible 2.1, support for configuring a 'fallback' directly in the argument specification was added, but we never got around to using it.
This PR finally cleans up the code and lets the argument parser directly handle fallback to environment variables.
ISSUE TYPE

Feature Pull Request

COMPONENT NAME
plugins/module_utils/botocore.py
plugins/module_utils/modules.py
ADDITIONAL INFORMATION

Reviewed-by: Mark Chappell <None>
abikouo pushed a commit to abikouo/amazon.aws that referenced this pull request Oct 24, 2023
Add changelog fragment for amazon.aws/825

SUMMARY
With ansible-collections#825 we now ignore aws: tags when purging.
Since affects both amazon.aws and community.aws add a changelog note to community.aws
ISSUE TYPE

Docs Pull Request

COMPONENT NAME
changelogs/fragments/817-skip_purge_aws.yaml
ADDITIONAL INFORMATION
See also:
ansible-collections#825
ansible-collections#817
ansible-collections#1146

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 community_review feature This issue/PR relates to a feature request mergeit Merge the PR (SoftwareFactory) module_utils module_utils needs_triage plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants