Fix the kolla_toolbox module do not work on docker engine 1.10
docker engine 1.10 and docker engine 1.12 have different response for list containers. Use status=running filter instead. It is provided by all docker version. Closes-Bug: #1658015 Change-Id: I54df4b08f215322d97d604ebd84e04255a359ef6
This commit is contained in:
parent
78b8f47bd5
commit
1aaca08b48
@ -87,14 +87,12 @@ def main():
|
||||
module = AnsibleModule(argument_spec=specs, bypass_checks=True)
|
||||
client = docker.Client()
|
||||
command_line = gen_commandline(module.params)
|
||||
kolla_toolbox = client.containers(all=True,
|
||||
filters=dict(name='kolla_toolbox'))
|
||||
kolla_toolbox = client.containers(filters=dict(name='kolla_toolbox',
|
||||
status='running'))
|
||||
if not kolla_toolbox:
|
||||
module.fail_json(msg='Can not find kolla_toolbox container in target')
|
||||
kolla_toolbox = kolla_toolbox[0]
|
||||
if kolla_toolbox['State'] != 'running':
|
||||
module.fail_json(msg='kolla_toolbox container is not running')
|
||||
module.fail_json(msg='kolla_toolbox container is not running.')
|
||||
|
||||
kolla_toolbox = kolla_toolbox[0]
|
||||
job = client.exec_create(kolla_toolbox, command_line)
|
||||
output = client.exec_start(job)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user