mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
tarfile does not support context in python 2.6
This commit is contained in:
parent
ba8b0cee1e
commit
d52f8b7c67
@ -41,20 +41,21 @@ def gen_thin(cachedir):
|
||||
]
|
||||
if HAS_MARKUPSAFE:
|
||||
tops.append(os.path.dirname(markupsafe.__file__))
|
||||
with tarfile.open(thintar, 'w:gz') as tfp:
|
||||
start_dir = os.getcwd()
|
||||
for top in tops:
|
||||
base = os.path.basename(top)
|
||||
os.chdir(os.path.dirname(top))
|
||||
for root, dirs, files in os.walk(base):
|
||||
for name in files:
|
||||
if not name.endswith(('.pyc', '.pyo')):
|
||||
tfp.add(os.path.join(root, name))
|
||||
os.chdir(os.path.dirname(salt.utils.which('salt-call')))
|
||||
tfp.add('salt-call')
|
||||
with open(thinver, 'w+') as fp_:
|
||||
fp_.write(salt.__version__)
|
||||
os.chdir(os.path.dirname(thinver))
|
||||
tfp.add('version')
|
||||
os.chdir(start_dir)
|
||||
tfp = tarfile.open(thintar, 'w:gz')
|
||||
start_dir = os.getcwd()
|
||||
for top in tops:
|
||||
base = os.path.basename(top)
|
||||
os.chdir(os.path.dirname(top))
|
||||
for root, dirs, files in os.walk(base):
|
||||
for name in files:
|
||||
if not name.endswith(('.pyc', '.pyo')):
|
||||
tfp.add(os.path.join(root, name))
|
||||
os.chdir(os.path.dirname(salt.utils.which('salt-call')))
|
||||
tfp.add('salt-call')
|
||||
with open(thinver, 'w+') as fp_:
|
||||
fp_.write(salt.__version__)
|
||||
os.chdir(os.path.dirname(thinver))
|
||||
tfp.add('version')
|
||||
os.chdir(start_dir)
|
||||
tfp.close()
|
||||
return thintar
|
||||
|
Loading…
Reference in New Issue
Block a user