Merge pull request #2704 from aiordache/cleanup

Fix condition to avoid syntax warning
This commit is contained in:
Anca Iordache 2020-11-19 18:18:09 +01:00 committed by GitHub
commit 5b471d4482
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 6 deletions

View File

@ -334,15 +334,11 @@ class HostConfig(dict):
if dns_search:
self['DnsSearch'] = dns_search
if network_mode is 'host' and port_bindings:
if network_mode == 'host' and port_bindings:
raise host_config_incompatible_error(
'network_mode', 'host', 'port_bindings'
)
if network_mode:
self['NetworkMode'] = network_mode
elif network_mode is None:
self['NetworkMode'] = 'default'
self['NetworkMode'] = network_mode or 'default'
if restart_policy:
if not isinstance(restart_policy, dict):