Skip to content

Commit d3a2d90

Browse files
committed
Merge pull request #462 from tutumcloud/fix_create_host_config
fix create_host_config method
2 parents aa19d7b + 3574167 commit d3a2d90

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docker/utils/utils.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -337,15 +337,15 @@ def create_host_config(
337337
volumes_from = volumes_from.split(',')
338338
host_config['VolumesFrom'] = volumes_from
339339

340-
if binds:
340+
if binds is not None:
341341
host_config['Binds'] = convert_volume_binds(binds)
342342

343-
if port_bindings:
343+
if port_bindings is not None:
344344
host_config['PortBindings'] = convert_port_bindings(
345345
port_bindings
346346
)
347347

348-
if extra_hosts:
348+
if extra_hosts is not None:
349349
if isinstance(extra_hosts, dict):
350350
extra_hosts = [
351351
'{0}:{1}'.format(k, v)
@@ -354,7 +354,7 @@ def create_host_config(
354354

355355
host_config['ExtraHosts'] = extra_hosts
356356

357-
if links:
357+
if links is not None:
358358
if isinstance(links, dict):
359359
links = six.iteritems(links)
360360

@@ -370,7 +370,7 @@ def create_host_config(
370370
formatted.append({'Key': k, 'Value': str(v)})
371371
lxc_conf = formatted
372372

373-
if lxc_conf:
373+
if lxc_conf is not None:
374374
host_config['LxcConf'] = lxc_conf
375375

376376
return host_config

0 commit comments

Comments
 (0)