From 81e9d1bde56f89edb2ca370a3c9e6838cff50072 Mon Sep 17 00:00:00 2001 From: Aaron Boushley Date: Fri, 9 Oct 2015 16:11:44 -0700 Subject: [PATCH] Fix issue with comparing versions improperly. This allows old versions of docker api to function. --- cloud/docker/docker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/docker/docker.py b/cloud/docker/docker.py index 0ab564208ba..ab71eb25b66 100644 --- a/cloud/docker/docker.py +++ b/cloud/docker/docker.py @@ -1088,7 +1088,7 @@ class DockerManager(object): self.module.fail_json(msg=str(e)) #For v1.19 API and above use HostConfig, otherwise use Config - if api_version >= 1.19: + if docker.utils.compare_version('1.19', api_version) >= 0: actual_mem = container['HostConfig']['Memory'] else: actual_mem = container['Config']['Memory'] @@ -1427,7 +1427,7 @@ class DockerManager(object): params['host_config'] = self.create_host_config() #For v1.19 API and above use HostConfig, otherwise use Config - if api_version < 1.19: + if docker.utils.compare_version('1.19', api_version) < 0: params['mem_limit'] = mem_limit else: params['host_config']['Memory'] = mem_limit