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

[PR #1434/5319437b backport][stable-1] json_query: Handle AnsibleUnicode, AnsibleUnsafeText #1443

Conversation

patchback[bot]
Copy link

@patchback patchback bot commented Dec 4, 2020

This is a backport of PR #1434 as merged into main (5319437).

SUMMARY

jmespath library does not undestand custom string types
such as AnsibleUnicode, and AnsibleUnsafeText.
So user need to use to_json | from_json filter while using
functions like starts_with and contains etc.
This hack will allow user to get rid of this filter.

Fixes: #320

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

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

changelogs/fragments/320_unsafe_text.yml
plugins/filter/json_query.py

jmespath library does not undestand custom string types
such as AnsibleUnicode, and AnsibleUnsafeText.
So user need to use ``to_json | from_json`` filter while using
functions like ``starts_with`` and ``contains`` etc.
This hack will allow user to get rid of this filter.

Fixes: #320

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit 5319437)
@ansibullbot ansibullbot added affects_2.10 bug This issue/PR relates to a bug community_review needs_triage new_contributor Help guide this first time contributor small_patch Hopefully easy to review labels Dec 4, 2020
@felixfontein felixfontein merged commit 9defd1a into stable-1 Dec 4, 2020
@felixfontein felixfontein deleted the patchback/backports/stable-1/5319437bc2930f81ea9f7999330eb32d984c4a88/pr-1434 branch December 4, 2020 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue/PR relates to a bug community_review needs_triage new_contributor Help guide this first time contributor small_patch Hopefully easy to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants