1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-12-01 04:38:12 +00:00

Fix a crash in Docker if daemon stop to respond

Fix #580
This commit is contained in:
Julien Duponchelle 2016-06-20 11:46:10 +02:00
parent f151181409
commit d1de665939
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -101,6 +101,7 @@ class Docker(BaseManager):
""" """
data = json.dumps(data) data = json.dumps(data)
url = "http://docker/" + path url = "http://docker/" + path
try:
response = yield from aiohttp.request( response = yield from aiohttp.request(
method, method,
url, url,
@ -109,6 +110,8 @@ class Docker(BaseManager):
data=data, data=data,
headers={"content-type": "application/json", }, headers={"content-type": "application/json", },
) )
except aiohttp.ClientResponseError as e:
raise DockerError("Docker has returned an error: {}".format(str(e)))
if response.status >= 300: if response.status >= 300:
body = yield from response.read() body = yield from response.read()
try: try: