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
parent a5bba2488f
commit 29e4a127e1

View file

@ -1108,8 +1108,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)