Support py3.5

This makes the process calls consistently return strings on all python
versions.

Change-Id: Ibda89b467b461b8833515f50a0cf1cc3064cb917
This commit is contained in:
Thomas Herve 2017-06-27 10:50:37 +02:00
parent c8e22e55af
commit a03cf787a1
3 changed files with 6 additions and 4 deletions

View File

@ -36,7 +36,9 @@ class DockerRunner(object):
cmd_stdout, cmd_stderr = subproc.communicate()
LOG.debug(cmd_stdout)
LOG.debug(cmd_stderr)
return cmd_stdout, cmd_stderr, subproc.returncode
return (cmd_stdout.decode('utf-8'),
cmd_stderr.decode('utf-8'),
subproc.returncode)
def current_config_ids(self):
# List all config_id labels for managed containers

View File

@ -28,7 +28,8 @@ class TestDockerRunner(base.TestCase):
def mock_execute(self, popen, stdout, stderr, returncode):
subproc = mock.Mock()
subproc.returncode = returncode
subproc.communicate.return_value = (stdout, stderr)
subproc.communicate.return_value = (stdout.encode('utf-8'),
stderr.encode('utf-8'))
popen.return_value = subproc
def assert_execute(self, popen, cmd):

View File

@ -16,8 +16,7 @@ classifier =
Programming Language :: Python :: 2
Programming Language :: Python :: 2.7
Programming Language :: Python :: 3
Programming Language :: Python :: 3.3
Programming Language :: Python :: 3.4
Programming Language :: Python :: 3.5
[files]
packages =