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

json_query: Handle AnsibleUnicode, AnsibleUnsafeText #1434

Merged
merged 1 commit into from
Dec 4, 2020

Conversation

Akasurde
Copy link
Member

@Akasurde Akasurde commented Dec 3, 2020

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

@ansibullbot ansibullbot added affects_2.10 bug This issue/PR relates to a bug community_review needs_triage small_patch Hopefully easy to review labels Dec 3, 2020
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: ansible-collections#320

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
@felixfontein felixfontein merged commit 5319437 into ansible-collections:main Dec 4, 2020
@felixfontein
Copy link
Collaborator

@Akasurde thanks for fixing this!

patchback bot pushed a commit that referenced this pull request Dec 4, 2020
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)
@Akasurde Akasurde deleted the i320 branch December 4, 2020 06:35
felixfontein pushed a commit that referenced this pull request Dec 4, 2020
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)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
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 small_patch Hopefully easy to review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

json_query filter fails when using the functions "contains", "starts_with", others
3 participants