mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Using cmd.retcode with an exit code different from zero will taint the '--retcode-passthrough' option. using python's regex instead of grep.
This commit is contained in:
parent
6d689d1eea
commit
8673a60111
@ -8,6 +8,7 @@ Extract an archive
|
||||
# Import Python libs
|
||||
from __future__ import absolute_import
|
||||
import os
|
||||
import re
|
||||
import logging
|
||||
import tarfile
|
||||
from contextlib import closing
|
||||
@ -211,7 +212,7 @@ def extracted(name,
|
||||
ret['result'] = False
|
||||
ret['changes'] = results
|
||||
return ret
|
||||
if __salt__['cmd.retcode']('tar --version | grep bsdtar', python_shell=True) == 0:
|
||||
if re.search('bsdtar', __salt__['cmd.run']('tar --version', python_shell=True)):
|
||||
files = results['stderr']
|
||||
else:
|
||||
files = results['stdout']
|
||||
|
Loading…
Reference in New Issue
Block a user