mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Use xz -t instead of xz -l to test if archive is packed with xz
lzma v4, which comes with CentOS 6, does not support -l
This commit is contained in:
parent
3fc1e2c9f8
commit
53d81f3804
@ -186,7 +186,7 @@ def list_(name,
|
||||
raise CommandExecutionError('Invalid CLI options')
|
||||
else:
|
||||
if salt.utils.which('xz') \
|
||||
and __salt__['cmd.retcode'](['xz', '-l', cached],
|
||||
and __salt__['cmd.retcode'](['xz', '-t', cached],
|
||||
python_shell=False,
|
||||
ignore_retcode=True) == 0:
|
||||
decompress_cmd = 'xz --decompress --stdout'
|
||||
|
@ -1193,7 +1193,7 @@ def extracted(name,
|
||||
except tarfile.ReadError:
|
||||
if salt.utils.which('xz'):
|
||||
if __salt__['cmd.retcode'](
|
||||
['xz', '-l', cached_source],
|
||||
['xz', '-t', cached_source],
|
||||
python_shell=False,
|
||||
ignore_retcode=True) == 0:
|
||||
# XZ-compressed data
|
||||
|
Loading…
Reference in New Issue
Block a user