Try the docker-py 2.0 client name first

This should give us a modest perfomance improvement as more people begin
to use docker-py>=2.0.
This commit is contained in:
Erik Johnson 2017-02-21 12:47:14 -06:00
parent dff35b58f8
commit da42040c1a

View file

@ -787,10 +787,10 @@ def _get_client(timeout=None):
client_kwargs['version'] = 'auto'
try:
__context__['docker.client'] = docker.Client(**client_kwargs)
except AttributeError:
# docker-py 2.0 renamed this client attribute
__context__['docker.client'] = docker.APIClient(**client_kwargs)
except AttributeError:
__context__['docker.client'] = docker.Client(**client_kwargs)
# Set a new timeout if one was passed
if timeout is not None and __context__['docker.client'].timeout != timeout: