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:
Toshio Kuratomi 2015-03-02 12:25:41 -08:00
commit a8c02b7049
10 changed files with 99 additions and 4 deletions

View file

@ -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"