This commit is contained in:
Mike Place 2016-08-20 11:10:59 +09:00
parent 42b43820ad
commit 3900d9069d

View File

@ -29,7 +29,7 @@ import salt.ext.six as six
from salt.utils import vt
from salt.exceptions import CommandExecutionError, TimedProcTimeoutError
from salt.log import LOG_LEVELS
from salt.ext.six.moves import range
from salt.ext.six.moves import range, zip
from salt.ext.six.moves import shlex_quote as _cmd_quote
# Only available on POSIX systems, nonfatal on windows
@ -394,9 +394,9 @@ def _run(cmd,
import itertools
env_runas = dict(itertools.izip(*[iter(env_encoded.split(b'\0'))]*2))
elif six.PY3:
if isinstance(env_encoded, str):
env_encoded = env_encoded.encode(__salt_system_encoding__)
env_runas = dict(zip(*[iter(env_encoded.split(b'\0'))]*2))
if isinstance(env_encoded, str):
env_encoded = env_encoded.encode(__salt_system_encoding__)
env_runas = dict(list(zip(*[iter(env_encoded.split(b'\0'))]*2)))
env_runas.update(env)
env = env_runas
# Encode unicode kwargs to filesystem encoding to avoid a