From ed0f5045eb284aea7e26db089132c04a1e4ac360 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 21 Jan 2015 19:50:34 -0500 Subject: [PATCH] moved defaulting to module constant to after when it is defined --- lib/ansible/modules/cloud/docker/docker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/ansible/modules/cloud/docker/docker.py b/lib/ansible/modules/cloud/docker/docker.py index f71bad42e7..b9c379eed4 100644 --- a/lib/ansible/modules/cloud/docker/docker.py +++ b/lib/ansible/modules/cloud/docker/docker.py @@ -524,6 +524,8 @@ class DockerManager(object): # connect to docker server docker_url = urlparse(module.params.get('docker_url')) docker_api_version = module.params.get('docker_api_version') + if not docker_api_version: + docker_api_version=docker.client.DEFAULT_DOCKER_API_VERSION self.client = docker.Client(base_url=docker_url.geturl(), version=docker_api_version) self.docker_py_versioninfo = get_docker_py_versioninfo() @@ -845,7 +847,7 @@ def main(): memory_limit = dict(default=0), memory_swap = dict(default=0), docker_url = dict(default='unix://var/run/docker.sock'), - docker_api_version = dict(default=docker.client.DEFAULT_DOCKER_API_VERSION), + docker_api_version = dict(), username = dict(default=None), password = dict(), email = dict(),