community.general/lib/ansible/modules/files
Virgil Dupras 930ea5dd55 unarchive: use Python's tarfile module for tar listing (#3575)
* unarchive: use Python's tarfile module for tar listing

fixes https://github.com/ansible/ansible/issues/11348

Depending on the current active locale, `tar`'s file listing can end up
spitting backslash-escaped characters. Unfortunately, when that happens,
we end up with double-escaped backslashes, giving us a wrong path,
making our action fail.

We could try un-double-escaping our paths, but that would be complicated
and, I think, error-prone. The easiest way forward seemed to simply use
the `tarfile` module.

Why use it only for listing? Because the `unarchive` option also
supports the `extra_opts` option, and that supporting this would require
us to mimick `tar`'s interface.

For listing files, however, I don't think that the loss of `extra_opts`
support causes problems (well, I hope so).

* unarchive: re-add xz decompression support

Following previous change to use Python's `tarfile` module for tar file
listing, we lost `xz` decompression support. This commits re-add it by
adding a special case in `TarXzArchive` that pre-decompresses the source
file.
2016-12-08 11:24:26 -05:00
..
__init__.py package files 2016-12-08 11:22:22 -05:00
acl.py Remove duplicate documentation fields 2016-12-08 11:24:01 -05:00
assemble.py Add prefixing and suffixing fuctionality to assemble 2016-12-08 11:24:14 -05:00
copy.py Also show stdout when validation fails. This fixes #2498 2016-12-08 11:24:09 -05:00
fetch.py Replace ansible_hostname with inventory_hostname (#3559) 2016-12-08 11:24:25 -05:00
file.py Remove old test on SELinux (#3510) 2016-12-08 11:24:20 -05:00
find.py removed 'overquoting' of example 2016-12-08 11:24:05 -05:00
ini_file.py ini_file: added option 'noextraspaces' to turn off inserting extra spaces around '=' symbol 2016-12-08 11:24:18 -05:00
lineinfile.py Fixed module doc typos 2016-12-08 11:24:06 -05:00
replace.py added follow to specific modules that support it 2016-12-08 11:24:06 -05:00
stat.py Change one param to be of type path 2016-12-08 11:24:08 -05:00
synchronize.py added rsync protocol support (#1999) 2016-12-08 11:24:16 -05:00
template.py Improve doc accuracy of template module 2016-12-08 11:24:17 -05:00
unarchive.py unarchive: use Python's tarfile module for tar listing (#3575) 2016-12-08 11:24:26 -05:00
xattr.py Set name to type path so that tilde and env vars are expanded 2016-12-08 11:24:08 -05:00