mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
parent
4d958f8677
commit
133318fb43
@ -191,18 +191,23 @@ def extracted(name,
|
||||
tar_cmd = ['tar']
|
||||
tar_shortopts = 'x'
|
||||
tar_longopts = []
|
||||
tar_afterfile = []
|
||||
|
||||
for opt in tar_opts:
|
||||
if not opt.startswith('-'):
|
||||
for shortopt in opt:
|
||||
if shortopt not in ['x', 'f']:
|
||||
tar_shortopts = tar_shortopts + shortopt
|
||||
else:
|
||||
for position, opt in enumerate(tar_opts):
|
||||
if opt.startswith('-'):
|
||||
tar_longopts.append(opt)
|
||||
else:
|
||||
if position > 0:
|
||||
tar_afterfile.append(opt)
|
||||
else:
|
||||
append_opt = opt
|
||||
append_opt = append_opt.replace('x', '').replace('f', '')
|
||||
tar_shortopts = tar_shortopts + append_opt
|
||||
|
||||
tar_cmd.append(tar_shortopts)
|
||||
tar_cmd.extend(tar_longopts)
|
||||
tar_cmd.extend(['-f', filename])
|
||||
tar_cmd.extend(tar_afterfile)
|
||||
|
||||
results = __salt__['cmd.run_all'](tar_cmd, cwd=name, python_shell=False)
|
||||
if results['retcode'] != 0:
|
||||
|
Loading…
Reference in New Issue
Block a user