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

use default values if environment variables are undefined #51961

Closed
wants to merge 1 commit into from

Conversation

provonet
Copy link
Contributor

@provonet provonet commented Feb 8, 2019

use the default values if ANSIBLE_CONSUL_URL is set, but ANSIBLE_CONSUL_VALIDATE_CERTS and ANSIBLE_CONSUL_CLIENT_CERT are undefined

SUMMARY

fix for issue #51960

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

consul_kv lookup plugin

ADDITIONAL INFORMATION

use the default values if ANSIBLE_CONSUL_URL is set, but ANSIBLE_CONSUL_VALIDATE_CERTS and ANSIBLE_CONSUL_CLIENT_CERT are undefined
@ansibot ansibot added affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. community_review In order to be merged, this PR must follow the community review workflow. needs_triage Needs a first human triage before being processed. small_patch support:community This issue/PR relates to code supported by the Ansible community. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Feb 8, 2019
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Feb 16, 2019
validate_certs = os.environ['ANSIBLE_CONSUL_VALIDATE_CERTS'] or True
client_cert = os.environ['ANSIBLE_CONSUL_CLIENT_CERT'] or None
validate_certs = os.environ.get('ANSIBLE_CONSUL_VALIDATE_CERTS', True)
client_cert = os.environ.get('ANSIBLE_CONSUL_CLIENT_CERT', None)
Copy link
Member

Choose a reason for hiding this comment

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

instead of manually assembling all the options, use set_options/get_option and all this will be resolved 'per option' in normal precedence order

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I just checked to code of the redis lookup, and yes that a better approach. I will update the pull request.

@ansibot ansibot added needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Mar 11, 2019
@ansibot ansibot added community_review In order to be merged, this PR must follow the community review workflow. and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. labels Mar 3, 2020
@ansibot ansibot added needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Mar 27, 2020
@ansibot ansibot added collection Related to Ansible Collections work collection:community.general needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md labels Apr 29, 2020
@Akasurde
Copy link
Member

@provonet Thanks for the contribution.

superseded by ansible-collections/community.general#303

@Akasurde Akasurde closed this Aug 11, 2020
@sivel sivel removed the needs_triage Needs a first human triage before being processed. label Aug 12, 2020
@ansible ansible locked and limited conversation to collaborators Sep 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.8 This issue/PR affects Ansible v2.8 bug This issue/PR relates to a bug. collection:community.general collection Related to Ansible Collections work needs_collection_redirect https://github.com/ansible/ansibullbot/blob/master/docs/collection_migration.md needs_rebase https://docs.ansible.com/ansible/devel/dev_guide/developing_rebasing.html needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. small_patch stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants