[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v1 42/42] tests/docker: don't always encoding for su
From: |
Alex Bennée |
Subject: |
[Qemu-devel] [PATCH v1 42/42] tests/docker: don't always encoding for subprocess.check_output |
Date: |
Wed, 4 Sep 2019 21:30:13 +0100 |
This was only added in Python 3.6 and not all the build hosts have
that recent a python3. However those that do will complain if
everything isn't properly utf-8 clean:
./tests/docker/docker.py --engine auto build qemu:debian-amd64
tests/docker/dockerfiles/debian-amd64.docker --add-current-user
Sending build context to Docker daemon 3.584kB
Step 1/16 : FROM qemu:debian9
pull access denied for qemu, repository does not exist or may require 'docker
login'
Traceback (most recent call last):
File "./tests/docker/docker.py", line 659, in <module>
sys.exit(main())
File "./tests/docker/docker.py", line 655, in main
return args.cmdobj.run(args, argv)
File "./tests/docker/docker.py", line 452, in run
extra_files_cksum=cksum)
File "./tests/docker/docker.py", line 306, in build_image
quiet=quiet)
File "./tests/docker/docker.py", line 231, in _do_check
return subprocess.check_call(self._command + cmd, **kwargs)
File "/usr/lib/python3.4/subprocess.py", line 561, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['docker', 'build', '-t',
'qemu:debian-amd64', '-f', '/tmp/docker_buildjvzs88tf/tmpyvtj7ub0.docker',
'/tmp/docker_buildjvzs88tf']' returned non-zero exit status 1
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
File "./tests/docker/docker.py", line 258, in _kill_instances
return self._do_kill_instances(True)
File "./tests/docker/docker.py", line 239, in _do_kill_instances
labels = json.loads(resp)[0]["Config"]["Labels"]
File "/usr/lib/python3.4/json/__init__.py", line 312, in loads
s.__class__.__name__))
TypeError: the JSON object must be str, not 'bytes'
make: *** [docker-image-debian-amd64] Error 1
Signed-off-by: Alex Bennée <address@hidden>
---
tests/docker/docker.py | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/tests/docker/docker.py b/tests/docker/docker.py
index 8f391eb278b..e5b7632464b 100755
--- a/tests/docker/docker.py
+++ b/tests/docker/docker.py
@@ -258,10 +258,16 @@ class Docker(object):
return self._do_kill_instances(True)
def _output(self, cmd, **kwargs):
- return subprocess.check_output(self._command + cmd,
- stderr=subprocess.STDOUT,
- encoding='utf-8',
- **kwargs)
+ if sys.version_info[1] >= 6:
+ return subprocess.check_output(self._command + cmd,
+ stderr=subprocess.STDOUT,
+ encoding='utf-8',
+ **kwargs)
+ else:
+ return subprocess.check_output(self._command + cmd,
+ stderr=subprocess.STDOUT,
+ **kwargs)
+
def inspect_tag(self, tag):
try:
--
2.20.1
- [Qemu-devel] [PATCH v1 24/42] tests/docker: add debian9-mxe to DEBIAN_PARTIAL_IMAGES, (continued)
- [Qemu-devel] [PATCH v1 24/42] tests/docker: add debian9-mxe to DEBIAN_PARTIAL_IMAGES, Alex Bennée, 2019/09/04
- [Qemu-devel] [PATCH v1 35/42] .travis.yml: Enable ccache on OSX, Alex Bennée, 2019/09/04
- [Qemu-devel] [PATCH v1 32/42] .travis.yml: Cache Python PIP packages, Alex Bennée, 2019/09/04
- [Qemu-devel] [PATCH v1 33/42] .travis.yml: Cache Avocado cache, Alex Bennée, 2019/09/04
- [Qemu-devel] [PATCH v1 21/42] tests/docker: drop debian-sid image, Alex Bennée, 2019/09/04
- [Qemu-devel] [PATCH v1 17/42] tests/docker: move our sh4 cross compile to Buster, Alex Bennée, 2019/09/04
- [Qemu-devel] [PATCH v1 28/42] tests/docker: add more images to PARTIAL_IMAGES when not on x86_64, Alex Bennée, 2019/09/04
- [Qemu-devel] [PATCH v1 42/42] tests/docker: don't always encoding for subprocess.check_output,
Alex Bennée <=
- [Qemu-devel] [PATCH v1 16/42] tests/docker: move our sparc64 cross compile to Buster, Alex Bennée, 2019/09/04
- [Qemu-devel] [PATCH v1 36/42] .travis.yml: Document how the build matrix use caches, Alex Bennée, 2019/09/04
- [Qemu-devel] [PATCH v1 40/42] Fedora images: use URLs from stable "archives.fedoraproject.org", Alex Bennée, 2019/09/04
- [Qemu-devel] [PATCH v1 38/42] .travis.yml: Cache Linux/GCC 'non-debug profile' jobs together, Alex Bennée, 2019/09/04
- [Qemu-devel] [PATCH v1 39/42] .travis.yml: Cache Linux/Clang jobs together, Alex Bennée, 2019/09/04
- [Qemu-devel] [PATCH v1 25/42] tests/docker: avoid $SHELL invoke bash directly, Alex Bennée, 2019/09/04
- [Qemu-devel] [PATCH v1 26/42] tests/docker: add debian-amd64-cross for non-x86 hosts, Alex Bennée, 2019/09/04