summaryrefslogtreecommitdiff
path: root/cloudinit/net
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2016-06-21 11:20:11 -0400
committerScott Moser <smoser@ubuntu.com>2016-06-21 11:20:11 -0400
commit575c7030e4ff1bd68ca7229f10c482af00620711 (patch)
treeacb99bd342bdc76279ff38f2cceec75196af1de5 /cloudinit/net
parentf21f3e262493b9f2f07710e51e7f0247e5132a22 (diff)
downloadvyos-cloud-init-575c7030e4ff1bd68ca7229f10c482af00620711.tar.gz
vyos-cloud-init-575c7030e4ff1bd68ca7229f10c482af00620711.zip
fix lost per-interface routes, use post-up to bring up interface aliases
Fix the lack of per-interface routes, and add an example to yaml. in revno 394 in curtin, we added post-up for interface aliases. bring that commit here.
Diffstat (limited to 'cloudinit/net')
-rw-r--r--cloudinit/net/eni.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/cloudinit/net/eni.py b/cloudinit/net/eni.py
index bb48a6eb..2da13ffd 100644
--- a/cloudinit/net/eni.py
+++ b/cloudinit/net/eni.py
@@ -369,11 +369,20 @@ class Renderer(renderer.Renderer):
if iface['mode'].startswith('dhcp'):
iface['mode'] = 'dhcp'
- sections.append(
+ lines = list(
_iface_start_entry(iface, index) +
_iface_add_subnet(iface, subnet) +
_iface_add_attrs(iface)
)
+ for route in subnet.get('routes', []):
+ lines.extend(self._render_route(route, indent=" "))
+
+ if len(subnets) > 1 and index == 0:
+ tmpl = " post-up ifup %s:%s\n"
+ for i in range(1, len(subnets)):
+ lines.append(tmpl % (iface['name'], i))
+
+ sections.append(lines)
else:
# ifenslave docs say to auto the slave devices
lines = []