Merge pull request #45099 from rallytime/bp-44983

Back-port #44983 to 2017.7
This commit is contained in:
Erik Johnson 2017-12-20 08:41:21 -06:00 committed by GitHub
commit 54a33c0e1d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -518,14 +518,14 @@ def tar(options, tarfile, sources=None, dest=None,
raise SaltInvocationError('Tar options can not be empty')
cmd = ['tar']
if dest:
cmd.extend(['-C', '{0}'.format(dest)])
if options:
cmd.extend(options.split())
cmd.extend(['{0}'.format(tarfile)])
cmd.extend(_expand_sources(sources))
if dest:
cmd.extend(['-C', '{0}'.format(dest)])
return __salt__['cmd.run'](cmd,
cwd=cwd,
template=template,