diff options
author | bernardopericacho <bernardopericacho@gmail.com> | 2015-01-16 15:25:42 +0100 |
---|---|---|
committer | bernardopericacho <bernardopericacho@gmail.com> | 2015-01-16 15:25:42 +0100 |
commit | 3574167fb055d7950e16d93529f1cfe586a253e1 (patch) | |
tree | bd47b4987be40d39db733e4bc5d3f9e29174c32c | |
parent | aa19d7b6609c6676e8258f6b900dea2eda1dbe95 (diff) | |
download | docker-py-3574167fb055d7950e16d93529f1cfe586a253e1.tar.gz |
fix create_host_config method
-rw-r--r-- | docker/utils/utils.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/docker/utils/utils.py b/docker/utils/utils.py index a554952..fdaf667 100644 --- a/docker/utils/utils.py +++ b/docker/utils/utils.py @@ -337,15 +337,15 @@ def create_host_config( volumes_from = volumes_from.split(',') host_config['VolumesFrom'] = volumes_from - if binds: + if binds is not None: host_config['Binds'] = convert_volume_binds(binds) - if port_bindings: + if port_bindings is not None: host_config['PortBindings'] = convert_port_bindings( port_bindings ) - if extra_hosts: + if extra_hosts is not None: if isinstance(extra_hosts, dict): extra_hosts = [ '{0}:{1}'.format(k, v) @@ -354,7 +354,7 @@ def create_host_config( host_config['ExtraHosts'] = extra_hosts - if links: + if links is not None: if isinstance(links, dict): links = six.iteritems(links) @@ -370,7 +370,7 @@ def create_host_config( formatted.append({'Key': k, 'Value': str(v)}) lxc_conf = formatted - if lxc_conf: + if lxc_conf is not None: host_config['LxcConf'] = lxc_conf return host_config |