Default net to 'bridge' in container diff

This prevents an unnecessary reload when the `net` parameter is unspecified
(i.e. almost always).
reviewable/pr18780/r1
Ash Wilson 10 years ago
parent a5bba2488f
commit 29e4a127e1

@ -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)

Loading…
Cancel
Save