mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 17:50:20 +00:00
Merge pull request #52753 from twangboy/skip_test_gen_thin
Skip test_gen_thin_compression_fallback_py3
This commit is contained in:
commit
3e46f5143d
2 changed files with 7 additions and 3 deletions
|
@ -327,8 +327,10 @@ def _get_thintar_prefix(tarname):
|
|||
:param tarname: name of the chosen tarball
|
||||
:return: prefixed tarname
|
||||
'''
|
||||
tfd, tmp_tarname = tempfile.mkstemp(dir=os.path.dirname(tarname), prefix=".thin-",
|
||||
suffix="." + os.path.basename(tarname).split(".", 1)[-1])
|
||||
tfd, tmp_tarname = tempfile.mkstemp(
|
||||
dir=os.path.dirname(tarname),
|
||||
prefix=".thin-",
|
||||
suffix=os.path.splitext(tarname)[1])
|
||||
os.close(tfd)
|
||||
|
||||
return tmp_tarname
|
||||
|
@ -458,7 +460,6 @@ def gen_thin(cachedir, extra_mods='', overwrite=False, so_mods='',
|
|||
elif compress == 'zip':
|
||||
tfp = zipfile.ZipFile(tmp_thintar, 'w', compression=zlib and zipfile.ZIP_DEFLATED or zipfile.ZIP_STORED)
|
||||
tfp.add = tfp.write
|
||||
|
||||
try: # cwd may not exist if it was removed but salt was run from it
|
||||
start_dir = os.getcwd()
|
||||
except OSError:
|
||||
|
|
|
@ -17,6 +17,7 @@ import salt.exceptions
|
|||
from salt.utils import thin
|
||||
from salt.utils import json
|
||||
import salt.utils.stringutils
|
||||
import salt.utils.platform
|
||||
from salt.utils.stringutils import to_bytes as bts
|
||||
from salt.ext.six.moves import range
|
||||
|
||||
|
@ -423,6 +424,8 @@ class SSHThinTestCase(TestCase):
|
|||
self.assertIn('The minimum required python version to run salt-ssh is '
|
||||
'"2.6"', str(err.value))
|
||||
|
||||
@skipIf(salt.utils.platform.is_windows() and thin._six.PY2,
|
||||
'Dies on Python2 on Windows')
|
||||
@patch('salt.exceptions.SaltSystemExit', Exception)
|
||||
@patch('salt.utils.thin.log', MagicMock())
|
||||
@patch('salt.utils.thin.os.makedirs', MagicMock())
|
||||
|
|
Loading…
Add table
Reference in a new issue