diff --git a/lib/ansible/template/native_helpers.py b/lib/ansible/template/native_helpers.py index e0df87dcb0da84..a24441f3799b32 100644 --- a/lib/ansible/template/native_helpers.py +++ b/lib/ansible/template/native_helpers.py @@ -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) diff --git a/test/integration/targets/jinja2_native_types/filter_plugins/native_plugins.py b/test/integration/targets/jinja2_native_types/filter_plugins/native_plugins.py deleted file mode 100644 index 24c716c42211b8..00000000000000 --- a/test/integration/targets/jinja2_native_types/filter_plugins/native_plugins.py +++ /dev/null @@ -1,8 +0,0 @@ -from ansible.module_utils._text import to_text - - -class FilterModule(object): - def filters(self): - return { - 'to_text': to_text, - } diff --git a/test/integration/targets/jinja2_native_types/test_casting.yml b/test/integration/targets/jinja2_native_types/test_casting.yml index 5b4fe3ac0eb32a..e66489ff5b1148 100644 --- a/test/integration/targets/jinja2_native_types/test_casting.yml +++ b/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 }}" diff --git a/test/integration/targets/jinja2_native_types/test_concatentation.yml b/test/integration/targets/jinja2_native_types/test_concatentation.yml index 478182ab454d99..8a8077b6699725 100644 --- a/test/integration/targets/jinja2_native_types/test_concatentation.yml +++ b/test/integration/targets/jinja2_native_types/test_concatentation.yml @@ -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: