From 23eebb62e661d560085ef84096c310ccd144b94d Mon Sep 17 00:00:00 2001 From: Matt Martz Date: Sat, 10 Jun 2017 08:52:27 -0500 Subject: [PATCH] Convert docker cmd output to native, early --- lib/ansible/plugins/connection/docker.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/plugins/connection/docker.py b/lib/ansible/plugins/connection/docker.py index 89bcae030f..6f2c44db24 100644 --- a/lib/ansible/plugins/connection/docker.py +++ b/lib/ansible/plugins/connection/docker.py @@ -35,7 +35,7 @@ from distutils.version import LooseVersion import ansible.constants as C from ansible.errors import AnsibleError, AnsibleFileNotFound from ansible.module_utils.six.moves import shlex_quote -from ansible.module_utils._text import to_bytes +from ansible.module_utils._text import to_bytes, to_native from ansible.plugins.connection import ConnectionBase, BUFSIZE @@ -113,7 +113,7 @@ class Connection(ConnectionBase): p = subprocess.Popen(old_docker_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) cmd_output, err = p.communicate() - return old_docker_cmd, cmd_output, err, p.returncode + return old_docker_cmd, to_native(cmd_output), err, p.returncode def _new_docker_version(self): # no result yet, must be newer Docker version @@ -126,7 +126,7 @@ class Connection(ConnectionBase): new_docker_cmd = [self.docker_cmd] + cmd_args + new_version_subcommand p = subprocess.Popen(new_docker_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) cmd_output, err = p.communicate() - return new_docker_cmd, cmd_output, err, p.returncode + return new_docker_cmd, to_native(cmd_output), err, p.returncode def _get_docker_version(self):