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

native types: literal_eval all the things #68938

Merged
merged 5 commits into from
Apr 17, 2020
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 0 additions & 4 deletions lib/ansible/template/native_helpers.py
Expand Up @@ -48,10 +48,6 @@ def ansible_native_concat(nodes):
# See https://github.com/ansible/ansible/issues/52158
# We do that only here because it is taken care of by to_text() in the else block below already.
str(out)

# short circuit literal_eval when possible
if not isinstance(out, list):
return out
else:
if isinstance(nodes, types.GeneratorType):
nodes = chain(head, nodes)
Expand Down

This file was deleted.

6 changes: 3 additions & 3 deletions test/integration/targets/jinja2_native_types/test_casting.yml
@@ -1,9 +1,9 @@
- name: cast things to other things
set_fact:
int_to_str: "{{ i_two|to_text }}"
int_to_str: "'{{ i_two }}'"
str_to_int: "{{ s_two|int }}"
dict_to_str: "{{ dict_one|to_text }}"
list_to_str: "{{ list_one|to_text }}"
dict_to_str: "'{{ dict_one }}'"
list_to_str: "'{{ list_one }}'"
int_to_bool: "{{ i_one|bool }}"
str_true_to_bool: "{{ s_true|bool }}"
str_false_to_bool: "{{ s_false|bool }}"
Expand Down
Expand Up @@ -18,7 +18,7 @@

- name: concatenate int and string
set_fact:
string_sum: "{{ [(i_one|to_text), s_two]|join('') }}"
string_sum: "'{{ [i_one, s_two]|join('') }}'"

- assert:
that:
Expand Down
2 changes: 0 additions & 2 deletions test/sanity/ignore.txt
Expand Up @@ -286,8 +286,6 @@ test/integration/targets/incidental_win_dsc/files/xTestDsc/1.0.1/DSCResources/AN
test/integration/targets/incidental_win_dsc/files/xTestDsc/1.0.1/xTestDsc.psd1 pslint!skip
test/integration/targets/incidental_win_ping/library/win_ping_syntax_error.ps1 pslint!skip
test/integration/targets/incidental_win_reboot/templates/post_reboot.ps1 pslint!skip
test/integration/targets/jinja2_native_types/filter_plugins/native_plugins.py future-import-boilerplate
test/integration/targets/jinja2_native_types/filter_plugins/native_plugins.py metaclass-boilerplate
test/integration/targets/lookup_ini/lookup-8859-15.ini no-smart-quotes
test/integration/targets/module_precedence/lib_with_extension/ping.py future-import-boilerplate
test/integration/targets/module_precedence/lib_with_extension/ping.py metaclass-boilerplate
Expand Down