mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #38851 from terminalmage/docker-py-2.0
Support docker-py 2.0 in dockerng
This commit is contained in:
commit
6430a45196
1 changed files with 5 additions and 1 deletions
|
@ -767,7 +767,11 @@ def _get_client(timeout=None):
|
|||
# it's not defined by user.
|
||||
client_kwargs['version'] = 'auto'
|
||||
|
||||
__context__['docker.client'] = docker.Client(**client_kwargs)
|
||||
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)
|
||||
|
||||
# Set a new timeout if one was passed
|
||||
if timeout is not None and __context__['docker.client'].timeout != timeout:
|
||||
|
|
Loading…
Add table
Reference in a new issue