From b8d1dcc3079bbf1bdbac258e4d1bc1ddbf98335e Mon Sep 17 00:00:00 2001 From: Erik Johnson Date: Tue, 2 May 2017 13:40:07 -0500 Subject: [PATCH] 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. --- salt/modules/dockerng.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/salt/modules/dockerng.py b/salt/modules/dockerng.py index 0ba7855e90..727329169b 100644 --- a/salt/modules/dockerng.py +++ b/salt/modules/dockerng.py @@ -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(