Fix issue with comparing versions improperly.
This allows old versions of docker api to function.
This commit is contained in:
parent
8638d9d26c
commit
876bdb62e1
1 changed files with 2 additions and 2 deletions
|
@ -1109,7 +1109,7 @@ class DockerManager(object):
|
||||||
self.module.fail_json(msg=str(e))
|
self.module.fail_json(msg=str(e))
|
||||||
|
|
||||||
#For v1.19 API and above use HostConfig, otherwise use 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:
|
||||||
actual_mem = container['HostConfig']['Memory']
|
actual_mem = container['HostConfig']['Memory']
|
||||||
else:
|
else:
|
||||||
actual_mem = container['Config']['Memory']
|
actual_mem = container['Config']['Memory']
|
||||||
|
@ -1483,7 +1483,7 @@ class DockerManager(object):
|
||||||
params['host_config'] = self.create_host_config()
|
params['host_config'] = self.create_host_config()
|
||||||
|
|
||||||
#For v1.19 API and above use HostConfig, otherwise use 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
|
params['mem_limit'] = mem_limit
|
||||||
else:
|
else:
|
||||||
params['host_config']['Memory'] = mem_limit
|
params['host_config']['Memory'] = mem_limit
|
||||||
|
|
Loading…
Reference in a new issue