diff options
| author | Scott Moser <smoser@ubuntu.com> | 2016-06-21 11:20:11 -0400 |
|---|---|---|
| committer | Scott Moser <smoser@ubuntu.com> | 2016-06-21 11:20:11 -0400 |
| commit | 0e5a1b99615ea4953fc82d01d624a0fa8d91d91b (patch) | |
| tree | acb99bd342bdc76279ff38f2cceec75196af1de5 /cloudinit | |
| parent | 5aedb31c6af7f671b7e1bdfbb91768f063165e46 (diff) | |
| download | cloud-init-0e5a1b99615ea4953fc82d01d624a0fa8d91d91b.tar.gz | |
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')
| -rw-r--r-- | cloudinit/net/eni.py | 11 |
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 = [] |
