diff options
author | Anca Iordache <aiordache@users.noreply.github.com> | 2020-11-19 18:18:09 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-19 18:18:09 +0100 |
commit | 5b471d44821e4a0018c57dffb46835c611d2cf82 (patch) | |
tree | a63abcf5fac0de2569cbd9e461f782ebbefde0cd | |
parent | 27e3fa3e2e2a198ae95399629c2d492368c95965 (diff) | |
parent | a0c51be2289dfa1ff05eb1834452e5808714b64a (diff) | |
download | docker-py-5b471d44821e4a0018c57dffb46835c611d2cf82.tar.gz |
Merge pull request #2704 from aiordache/cleanup
Fix condition to avoid syntax warning
-rw-r--r-- | docker/types/containers.py | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/docker/types/containers.py b/docker/types/containers.py index d1938c9..9fa4656 100644 --- a/docker/types/containers.py +++ b/docker/types/containers.py @@ -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): |