Default net to 'bridge' in container diff

This prevents an unnecessary reload when the `net` parameter is unspecified
(i.e. almost always).
This commit is contained in:
Ash Wilson 2015-06-25 17:11:38 -05:00 committed by Matt Clay
parent 9b3aa0a9d4
commit 9f12fd0a26

View file

@ -1115,8 +1115,8 @@ class DockerManager(object):
# NETWORK MODE
expected_netmode = self.module.params.get('net') or ''
actual_netmode = container['HostConfig']['NetworkMode']
expected_netmode = self.module.params.get('net') or 'bridge'
actual_netmode = container['HostConfig']['NetworkMode'] or 'bridge'
if actual_netmode != expected_netmode:
self.reload_reasons.append('net ({0} => {1})'.format(actual_netmode, expected_netmode))
differing.append(container)