mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Don't use docker.Client instance from context if missing attributes
Under some circumstances (which I can't reliably reproduce), the docker.Client() instance does not have a timeout attribute, causing anything that needs to use the docker client to result in a traceback. This fixes this corner case (later branches initialize the timeout differently).
This commit is contained in:
parent
4526fc6e08
commit
869416e7db
1 changed files with 2 additions and 1 deletions
|
@ -775,7 +775,8 @@ def _get_client(timeout=None):
|
|||
- docker.url: URL to the docker service
|
||||
- docker.version: API version to use (default: "auto")
|
||||
'''
|
||||
if 'docker.client' not in __context__:
|
||||
if 'docker.client' not in __context__ \
|
||||
or not hasattr(__context__['docker.client'], 'timeout'):
|
||||
client_kwargs = {}
|
||||
for key, val in (('base_url', 'docker.url'),
|
||||
('version', 'docker.version')):
|
||||
|
|
Loading…
Add table
Reference in a new issue