1
0
mirror of https://github.com/GNS3/gns3-server synced 2024-11-24 17:28:08 +00:00

Use versioned docker API

Since docker v1.13 the unversioned docker API is deprecated.
Backport of gns3-server 2.0, commit effbe59
This commit is contained in:
Bernhard Ehlers 2017-05-02 10:37:29 +02:00 committed by Julien Duponchelle
parent 1e598d1890
commit 7d48eba01b
No known key found for this signature in database
GPG Key ID: CE8B29639E07F5E8

View File

@ -113,11 +113,13 @@ class Docker(BaseManager):
:returns: HTTP response :returns: HTTP response
""" """
data = json.dumps(data) data = json.dumps(data)
url = "http://docker/v" + DOCKER_MINIMUM_API_VERSION + "/" + path
if timeout is None: if timeout is None:
timeout = 60 * 60 * 24 * 31 # One month timeout timeout = 60 * 60 * 24 * 31 # One month timeout
if path == 'version':
url = "http://docker/v1.12/" + path # API of docker v1.0
else:
url = "http://docker/v" + DOCKER_MINIMUM_API_VERSION + "/" + path
try: try:
if path != "version": # version is use by check connection if path != "version": # version is use by check connection
yield from self._check_connection() yield from self._check_connection()