From 7a3564a7467459f8700bd98d9036c99ca367b446 Mon Sep 17 00:00:00 2001 From: Maxime Petazzoni Date: Fri, 15 Nov 2013 14:56:17 -0800 Subject: [PATCH 1/3] Restore disabling timeout on image pull Signed-off-by: Maxime Petazzoni --- docker/client.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/client.py b/docker/client.py index 2c6431a6..90a32a1e 100644 --- a/docker/client.py +++ b/docker/client.py @@ -524,7 +524,8 @@ class Client(requests.Session): if authcfg: headers['X-Registry-Auth'] = auth.encode_header(authcfg) u = self._url("/images/create") - response = self._post(u, params=params, headers=headers, stream=stream) + response = self._post(u, params=params, headers=headers, stream=stream, + timeout=None) if stream: return self._stream_helper(response) From 8c4c7c3d4959b38cac7585779032a801c3fe7fd8 Mon Sep 17 00:00:00 2001 From: Maxime Petazzoni Date: Tue, 19 Nov 2013 13:37:03 -0800 Subject: [PATCH 2/3] Ensure sorted order on links to make unit test deterministic Signed-off-by: Maxime Petazzoni --- docker/client.py | 2 +- tests/test.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docker/client.py b/docker/client.py index 90a32a1e..b99aebe5 100644 --- a/docker/client.py +++ b/docker/client.py @@ -609,7 +609,7 @@ class Client(requests.Session): if links: formatted_links = [ - '{0}:{1}'.format(k, v) for k, v in six.iteritems(links) + '{0}:{1}'.format(k, v) for k, v in sorted(six.iteritems(links)) ] start_config['Links'] = formatted_links diff --git a/tests/test.py b/tests/test.py index f1d42462..e058d287 100644 --- a/tests/test.py +++ b/tests/test.py @@ -348,7 +348,7 @@ class DockerClientTest(unittest.TestCase): {'Content-Type': 'application/json'} ) - # multiple links + def test_start_container_with_multiple_links(self): try: link_path = 'path' alias = 'alias' @@ -371,7 +371,7 @@ class DockerClientTest(unittest.TestCase): json.loads(args[1]['data']), { "PublishAllPorts": False, - "Links": ["path2:alias2", "path1:alias1"] + "Links": ["path1:alias1", "path2:alias2"] } ) self.assertEqual( From 058c2798cc2b04135bd82ce9392d7a7f772ef491 Mon Sep 17 00:00:00 2001 From: Maxime Petazzoni Date: Tue, 19 Nov 2013 13:40:03 -0800 Subject: [PATCH 3/3] Fix under-indented line Signed-off-by: Maxime Petazzoni --- docker/client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/client.py b/docker/client.py index b99aebe5..05eee023 100644 --- a/docker/client.py +++ b/docker/client.py @@ -525,7 +525,7 @@ class Client(requests.Session): headers['X-Registry-Auth'] = auth.encode_header(authcfg) u = self._url("/images/create") response = self._post(u, params=params, headers=headers, stream=stream, - timeout=None) + timeout=None) if stream: return self._stream_helper(response)