Merge pull request #49368 from rallytime/bp-49322

Back-port #49322 to 2018.3.3
This commit is contained in:
Nicole Thomas 2018-08-28 13:15:14 -04:00 committed by GitHub
commit af80e64569
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 1 deletions

View File

@ -40,6 +40,8 @@ class TimedProc(object):
if self.timeout and not isinstance(self.timeout, (int, float)):
raise salt.exceptions.TimedProcTimeoutError('Error: timeout {0} must be a number'.format(self.timeout))
if kwargs.get('shell', False):
args = salt.utils.stringutils.to_bytes(args)
try:
self.process = subprocess.Popen(args, **kwargs)

View File

@ -1953,7 +1953,10 @@ class StateModuleTest(ModuleCase, SaltReturnAssertsMixin):
_expected = 'This is Æ test!'
if salt.utils.platform.is_windows():
# Windows cmd.exe will mangle the output using cmd's codepage.
_expected = "'This is test!'"
if six.PY2:
_expected = "'This is A+ test!'"
else:
_expected = "'This is test!'"
self.assertEqual(_expected, ret[key]['changes']['stdout'])
def tearDown(self):