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:
Alexander Schwartz 2015-02-07 10:00:34 +01:00
parent 6d689d1eea
commit 8673a60111

View File

@ -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']