Skip to content

Commit

Permalink
Merge pull request #2704 from aiordache/cleanup
Browse files Browse the repository at this point in the history
Fix condition to avoid syntax warning
  • Loading branch information
aiordache authored Nov 19, 2020
2 parents 27e3fa3 + a0c51be commit 5b471d4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions docker/types/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -334,15 +334,11 @@ def __init__(self, version, binds=None, port_bindings=None,
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):
Expand Down

0 comments on commit 5b471d4

Please sign in to comment.