Merge pull request #2521 from wrouesnel/docker_reloaded_fixes

docker: Fix state=reloaded to detect default LoggingDriver for docker
This commit is contained in:
Brian Coca 2016-01-12 10:47:30 -05:00
commit 9d4403f2b3

View file

@ -1084,6 +1084,7 @@ class DockerManager(object):
running = self.get_running_containers()
current = self.get_inspect_containers(running)
defaults = self.client.info()
#Get API version
api_version = self.client.version()['ApiVersion']
@ -1411,7 +1412,7 @@ class DockerManager(object):
# LOG_DRIVER
if self.ensure_capability('log_driver', False):
expected_log_driver = self.module.params.get('log_driver') or 'json-file'
expected_log_driver = self.module.params.get('log_driver') or defaults['LoggingDriver']
actual_log_driver = container['HostConfig']['LogConfig']['Type']
if actual_log_driver != expected_log_driver:
self.reload_reasons.append('log_driver ({0} => {1})'.format(actual_log_driver, expected_log_driver))