Fix TypeError: http_query() got an unexpected keyword argument 'timeout'

Fix #947
This commit is contained in:
Julien Duponchelle committed 2017-03-20 17:06:00 +01:00
1 parent bc0e4c1174
commit a62b791c68
2 files changed
+9 -4

No files matched your search

+3 -1
View File
@@ -93,7 +93,7 @@ class Docker(BaseManager):
return body
@asyncio.coroutine
def http_query(self, method, path, data={}, params={}):
def http_query(self, method, path, data={}, params={}, timeout=300):
"""
Make a query to the docker daemon
@@ -101,6 +101,7 @@ class Docker(BaseManager):
:param path: Endpoint in API
:param data: Dictionnary with the body. Will be transformed to a JSON
:param params: Parameters added as a query arg
:param timeout: Timeout
:returns: HTTP response
"""
data = json.dumps(data)
@@ -113,6 +114,7 @@ class Docker(BaseManager):
params=params,
data=data,
headers={"content-type": "application/json", },
timeout=timeout
)
except (aiohttp.ClientResponseError, aiohttp.ClientOSError) as e:
raise DockerError("Docker has returned an error: {}".format(str(e)))