Merge pull request #2239 from boushley/devel

Fix issue with comparing versions improperly
This commit is contained in:
Brian Coca 2015-12-14 21:59:27 -05:00
commit a876704740

View file

@ -1099,7 +1099,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']
@ -1440,7 +1440,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