mirror of https://github.com/docker/docker-py.git
Fix case when "network_config" is not passed
Signed-off-by: Mariano Scazzariello <marianoscazzariello@gmail.com>
This commit is contained in:
parent
a18f91bf08
commit
7870503c52
|
|
@ -1148,14 +1148,14 @@ def _create_container_args(kwargs):
|
||||||
network = kwargs.pop('network', None)
|
network = kwargs.pop('network', None)
|
||||||
network_config = kwargs.pop('network_config', None)
|
network_config = kwargs.pop('network_config', None)
|
||||||
if network:
|
if network:
|
||||||
network_configuration = EndpointConfig(
|
endpoint_config = EndpointConfig(
|
||||||
host_config_kwargs['version'],
|
host_config_kwargs['version'],
|
||||||
**network_config
|
**network_config
|
||||||
) if network_config else None
|
) if network_config else None
|
||||||
|
|
||||||
create_kwargs['networking_config'] = NetworkingConfig(
|
create_kwargs['networking_config'] = NetworkingConfig(
|
||||||
{network: network_configuration}
|
{network: endpoint_config}
|
||||||
)
|
) if endpoint_config else {network: None}
|
||||||
host_config_kwargs['network_mode'] = network
|
host_config_kwargs['network_mode'] = network
|
||||||
|
|
||||||
# All kwargs should have been consumed by this point, so raise
|
# All kwargs should have been consumed by this point, so raise
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue