mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Use cmd_unzip to preserve permissions
This commit is contained in:
parent
09602808a0
commit
1726057c8a
1 changed files with 5 additions and 6 deletions
|
@ -172,18 +172,17 @@ def extracted(name,
|
|||
|
||||
__salt__['file.makedirs'](name, user=archive_user)
|
||||
|
||||
if archive_format in ('zip', 'rar'):
|
||||
log.debug('Extract {0} in {1}'.format(filename, name))
|
||||
files = __salt__['archive.un{0}'.format(archive_format)](filename,
|
||||
name)
|
||||
log.debug('Extract {0} in {1}'.format(filename, name))
|
||||
if archive_format == 'zip':
|
||||
files = __salt__['archive.cmd_unzip'](filename, name)
|
||||
elif archive_format == 'rar':
|
||||
files = __salt__['archive.unrar'](filename, name)
|
||||
else:
|
||||
if tar_options is None:
|
||||
with closing(tarfile.open(filename, 'r')) as tar:
|
||||
files = tar.getnames()
|
||||
tar.extractall(name)
|
||||
else:
|
||||
log.debug('Untar {0} in {1}'.format(filename, name))
|
||||
|
||||
tar_opts = tar_options.split(' ')
|
||||
|
||||
tar_cmd = ['tar']
|
||||
|
|
Loading…
Add table
Reference in a new issue