docker_container: fix container creation with networks_cli_compatible=yes (#56687)

* Fix behavior.

* Add changelog.

* Add simple test to prevent #56620.
This commit is contained in:
Felix Fontein 2019-05-28 09:19:52 +02:00 committed by ansibot
parent baac1df935
commit d8dcd20294
3 changed files with 6 additions and 1 deletions

View file

@ -1282,7 +1282,7 @@ class TaskParameters(DockerBaseClass):
if network.get(para):
params[para] = network[para]
network_config = dict()
network_config[network['name']] = self.client.create_endpoint_config(params)
network_config[network['name']] = self.client.create_endpoint_config(**params)
result['networking_config'] = self.client.create_networking_config(network_config)
return result