From cae6989932c69dc1ef3d3b221d06633f880841c8 Mon Sep 17 00:00:00 2001 From: Alex Willmer Date: Mon, 9 Oct 2017 22:05:02 +0100 Subject: [PATCH] testlib: Auto negotiate Docker API version Ubuntu 17.04 provides Docker 1.12.6, which has API version 1.24. `dev_requirements.txt` specifies the docker-py 2.5.1, which by default requests API version 1.30. Hence when the SSH unit tests try to run the container specified in `DockerizedSshDaemon` an error occurs ``` APIError: 400 Client Error: Bad Request ("client is newer than server (client API version: 1.30, server API version: 1.24)") ``` --- tests/testlib.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testlib.py b/tests/testlib.py index fb6e55e9..294b09c0 100644 --- a/tests/testlib.py +++ b/tests/testlib.py @@ -42,7 +42,7 @@ class TestCase(unittest.TestCase): class DockerizedSshDaemon(object): def __init__(self): - self.docker = docker.from_env() + self.docker = docker.from_env(version='auto') self.container_name = 'mitogen-test-%08x' % (random.getrandbits(64),) self.container = self.docker.containers.run( image='d2mw/mitogen-test',