From 29e4a127e19fee326c5c698d249f6b9791b9e705 Mon Sep 17 00:00:00 2001 From: Ash Wilson Date: Thu, 25 Jun 2015 17:11:38 -0500 Subject: [PATCH] Default net to 'bridge' in container diff This prevents an unnecessary reload when the `net` parameter is unspecified (i.e. almost always). --- cloud/docker/docker.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/docker/docker.py b/cloud/docker/docker.py index 9986c94f9ec..a6090c4b0c1 100644 --- a/cloud/docker/docker.py +++ b/cloud/docker/docker.py @@ -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)