mirror of
https://github.com/ansible-collections/community.general.git
synced 2026-05-08 14:22:46 +00:00
Rework the shell quoting of remote checksumming
Instead of getting rid of pipes.quote, use pipes.quote and get rid of the manually entered toplevel quotes. This should properly escape backslashes, quotes, and other characters. Also fix the new checksumming python "one-liner" for csh. ansible_shell_type needs to be set to csh. Fixes #10363 Fixes #10353
This commit is contained in:
@@ -138,3 +138,39 @@
|
||||
that:
|
||||
- "template_result.changed == False"
|
||||
|
||||
# Test strange filenames
|
||||
|
||||
- name: Create a temp dir for filename tests
|
||||
file:
|
||||
state: directory
|
||||
dest: '{{ output_dir }}/filename-tests'
|
||||
|
||||
- name: create a file with an unusual filename
|
||||
template:
|
||||
src: foo.j2
|
||||
dest: "{{ output_dir }}/filename-tests/foo t'e~m\\plated"
|
||||
register: template_result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "template_result.changed == True"
|
||||
|
||||
- name: check that the unusual filename was created
|
||||
command: "ls {{ output_dir }}/filename-tests/"
|
||||
register: unusual_results
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "\"foo t'e~m\\plated\" in unusual_results.stdout_lines"
|
||||
- "{{unusual_results.stdout_lines| length}} == 1"
|
||||
|
||||
- name: check that the unusual filename can be checked for changes
|
||||
template:
|
||||
src: foo.j2
|
||||
dest: "{{ output_dir }}/filename-tests/foo t'e~m\\plated"
|
||||
register: template_result
|
||||
|
||||
- assert:
|
||||
that:
|
||||
- "template_result.changed == False"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user