Merge pull request #37358 from Firewire2002/2016.3.3_issue37355

Fix/workaround for issue #37355
This commit is contained in:
Mike Place 2017-01-06 11:58:47 -07:00 committed by GitHub
commit 5e58b32934

View File

@ -292,6 +292,18 @@ def gen_thin(cachedir, extra_mods='', overwrite=False, so_mods='',
if tempdir is not None: if tempdir is not None:
shutil.rmtree(tempdir) shutil.rmtree(tempdir)
tempdir = None tempdir = None
# symlink for backports directory on old distributions
tmpbackports = tempfile.mkdtemp(suffix='_backports_workaround', prefix='salt_')
tmpbackports_symlink = os.path.join(tmpbackports, 'symlink')
os.symlink('salt/ext', tmpbackports_symlink)
tfp_deref_old = tfp.dereference
tfp.dereference = False
tfp.add(tmpbackports_symlink, arcname=os.path.join('py{0}'.format(py_ver), 'backports'))
tfp.dereference = tfp_deref_old
shutil.rmtree(tmpbackports)
# workaround end
os.chdir(thindir) os.chdir(thindir)
tfp.add('salt-call') tfp.add('salt-call')
with salt.utils.fopen(thinver, 'w+') as fp_: with salt.utils.fopen(thinver, 'w+') as fp_: