Commit 8dcfb1b7 authored by Alex Willmer's avatar Alex Willmer Committed by David Wilson

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)")
```
parent 94992940
......@@ -114,7 +114,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',
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment