From d1e8eb73aca6a3f5cee415774dcf540e934ec250 Mon Sep 17 00:00:00 2001 From: Ryan Harper Date: Fri, 9 Jun 2017 12:35:11 -0500 Subject: sysconfig: include GATEWAY value if set in subnet Render the GATEWAY= value in interface files which have a gateway in the subnet configuration. LP: #1686856 --- cloudinit/net/sysconfig.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'cloudinit/net') diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py index 7ed11d1e..ad8c268e 100644 --- a/cloudinit/net/sysconfig.py +++ b/cloudinit/net/sysconfig.py @@ -329,6 +329,9 @@ class Renderer(renderer.Renderer): iface_cfg['NETMASK' + suff] = \ net_prefix_to_ipv4_mask(subnet['prefix']) + if 'gateway' in subnet: + iface_cfg['GATEWAY'] = subnet['gateway'] + @classmethod def _render_subnet_routes(cls, iface_cfg, route_cfg, subnets): for i, subnet in enumerate(subnets, start=len(iface_cfg.children)): -- cgit v1.2.3