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

filters: Add additional Truth values to bool filter #54969

Open
wants to merge 3 commits into
base: devel
from

Conversation

Projects
None yet
3 participants
@Akasurde
Copy link
Member

commented Apr 8, 2019

SUMMARY

Fixes: #54964

Signed-off-by: Abhijeet Kasurde akasurde@redhat.com

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

lib/ansible/plugins/filter/core.py
test/integration/targets/filters/files/foo.txt
test/integration/targets/filters/templates/foo.j2

@bcoca

This comment has been minimized.

Copy link
Member

commented Apr 9, 2019

this needs at least to be a toggle to enable the new behaviour

@bcoca bcoca removed the needs_triage label Apr 9, 2019

@ansibot ansibot added core_review and removed needs_revision labels Apr 9, 2019

@bcoca
Copy link
Member

left a comment

do not change current behaviour in backwards incompatible ways

@ansibot ansibot added needs_revision and removed core_review labels Apr 10, 2019

Akasurde added some commits Apr 8, 2019

filters: Add additional Truth values to bool filter
Fixes: #54964

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Fix windows test case
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
review comments and docs
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
@ansibot

This comment has been minimized.

Copy link
Contributor

commented Apr 15, 2019

@ansibot ansibot added docs and removed small_patch labels Apr 15, 2019

@Akasurde Akasurde requested a review from bcoca Apr 16, 2019

''' return a bool for the arg '''
if a is None or isinstance(a, bool):
return a
if isinstance(a, string_types):
a = a.lower()
if a in ('yes', 'on', '1', 'true', 1):
if extended:

This comment has been minimized.

Copy link
@bcoca

bcoca Apr 16, 2019

Member

instead of extended we might want logic=python|jinja|yaml|ansible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.