mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Merge pull request #2651 from bclermont/fix-cwd-tar
add current working directory argument, to allow to extract tarball elsewhere than $HOME
This commit is contained in:
commit
2043c1c33f
@ -15,7 +15,7 @@ def __virtual__():
|
||||
return 'archive'
|
||||
|
||||
|
||||
def tar(options, tarfile, *sources):
|
||||
def tar(options, tarfile, cwd=None, *sources):
|
||||
'''
|
||||
Uses the tar command to pack, unpack, etc tar files
|
||||
|
||||
@ -25,7 +25,7 @@ def tar(options, tarfile, *sources):
|
||||
'''
|
||||
sourcefiles = ' '.join(sources)
|
||||
cmd = 'tar -{0} {1} {2}'.format(options, tarfile, sourcefiles)
|
||||
out = __salt__['cmd.run'](cmd).splitlines()
|
||||
out = __salt__['cmd.run'](cmd, cwd).splitlines()
|
||||
return out
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user