summaryrefslogtreecommitdiff
path: root/cloudinit/distros
diff options
context:
space:
mode:
authorJoshua Harlow <harlowja@yahoo-inc.com>2012-09-20 15:55:52 -0700
committerJoshua Harlow <harlowja@yahoo-inc.com>2012-09-20 15:55:52 -0700
commite055c795581c2846aa6ae128de8cfd0b2c5d3f32 (patch)
treed64dbeb929f9550975c0e26715452f07894c3a7a /cloudinit/distros
parent6208fe41e4e73d1f14fd4afc152565c8908684a2 (diff)
downloadvyos-cloud-init-e055c795581c2846aa6ae128de8cfd0b2c5d3f32.tar.gz
vyos-cloud-init-e055c795581c2846aa6ae128de8cfd0b2c5d3f32.zip
Instead of special casing the empty list
we are going to check for the 'all' entry and if that exists then only fire off one call (since debian supports this).
Diffstat (limited to 'cloudinit/distros')
-rw-r--r--cloudinit/distros/debian.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/cloudinit/distros/debian.py b/cloudinit/distros/debian.py
index 777c8530..88f4e978 100644
--- a/cloudinit/distros/debian.py
+++ b/cloudinit/distros/debian.py
@@ -56,12 +56,17 @@ class Distro(distros.Distro):
def _write_network(self, settings):
net_fn = self._paths.join(False, "/etc/network/interfaces")
util.write_file(net_fn, settings)
- return []
+ return ['all']
def _bring_up_interfaces(self, device_names):
- if not device_names:
- device_names = ['--all']
- return distros.Distro._bring_up_interfaces(self, device_names)
+ use_all = False
+ for d in device_names:
+ if d == 'all':
+ use_all = True
+ if use_all:
+ return distros.Distro._bring_up_interface(self, '--all')
+ else:
+ return distros.Distro._bring_up_interfaces(self, device_names)
def set_hostname(self, hostname):
out_fn = self._paths.join(False, "/etc/hostname")