mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 22:11:14 +02:00
Use aiohttp session for docker queries
This commit is contained in:
2 files changed
+6
-4
No files matched your search
@@ -107,7 +107,8 @@ class Docker(BaseManager):
|
||||
data = json.dumps(data)
|
||||
url = "http://docker/" + path
|
||||
try:
|
||||
response = yield from aiohttp.request(
|
||||
session = aiohttp.ClientSession()
|
||||
response = yield from session.request(
|
||||
method,
|
||||
url,
|
||||
connector=(yield from self.connector()),
|
||||
@@ -116,6 +117,7 @@ class Docker(BaseManager):
|
||||
headers={"content-type": "application/json", },
|
||||
timeout=timeout
|
||||
)
|
||||
yield from session.close()
|
||||
except (aiohttp.ClientResponseError, aiohttp.ClientOSError) as e:
|
||||
raise DockerError("Docker has returned an error: {}".format(str(e)))
|
||||
if response.status >= 300:
|
||||
|
||||
Reference in new issue
Block a user