mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Use proposed docker-py reload_config() func
See https://github.com/docker/docker-py/pull/1586 This allows an existing client instance to disregard its cached auth config and use the most up-to-date login info from the config.json.
This commit is contained in:
parent
19894f68ca
commit
b8d1dcc307
@ -818,8 +818,14 @@ def _client_wrapper(attr, *args, **kwargs):
|
||||
'''
|
||||
catch_api_errors = kwargs.pop('catch_api_errors', True)
|
||||
func = getattr(__context__['docker.client'], attr, None)
|
||||
if func is None:
|
||||
if func is None or not hasattr(func, '__call__'):
|
||||
raise SaltInvocationError('Invalid client action \'{0}\''.format(attr))
|
||||
if attr in ('push', 'pull'):
|
||||
try:
|
||||
# Refresh auth config from config.json
|
||||
__context__['docker.client'].reload_config()
|
||||
except AttributeError:
|
||||
pass
|
||||
err = ''
|
||||
try:
|
||||
log.debug(
|
||||
|
Loading…
Reference in New Issue
Block a user