summaryrefslogtreecommitdiff
path: root/cloudinit/net/sysconfig.py
diff options
context:
space:
mode:
authorRyan Harper <ryan.harper@canonical.com>2020-01-08 11:30:17 -0600
committerChad Smith <chad.smith@canonical.com>2020-01-08 10:30:17 -0700
commitdacdd30080bd8183d1f1c1dc9dbcbc8448301529 (patch)
treeba79741418d3fb6f5c779fe37674263a3545c131 /cloudinit/net/sysconfig.py
parent6aa14766a7039333aac6f75dc442fa58dc4e692f (diff)
downloadvyos-cloud-init-dacdd30080bd8183d1f1c1dc9dbcbc8448301529.tar.gz
vyos-cloud-init-dacdd30080bd8183d1f1c1dc9dbcbc8448301529.zip
net: fix rendering of 'static6' in network config (#77)
* net: fix rendering of 'static6' in network config A V1 static6 network typo was misrendered in eni, it's not valid. It was ignored in sysconfig and netplan. This branch fixes eni, updates sysconfig, netplan to render it correctly and adds unittests for all cases. Reported-by: Raphaƫl Enrici LP: #1850988 * net: add comment about static6 type in subnet_is_ipv6 Co-authored-by: Chad Smith <blackboxsw@gmail.com> Co-authored-by: Daniel Watkins <daniel@daniel-watkins.co.uk>
Diffstat (limited to 'cloudinit/net/sysconfig.py')
-rw-r--r--cloudinit/net/sysconfig.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
index 310cdf01..3e06af01 100644
--- a/cloudinit/net/sysconfig.py
+++ b/cloudinit/net/sysconfig.py
@@ -367,7 +367,7 @@ class Renderer(renderer.Renderer):
iface_cfg['IPV6_AUTOCONF'] = True
elif subnet_type in ['dhcp4', 'dhcp']:
iface_cfg['BOOTPROTO'] = 'dhcp'
- elif subnet_type == 'static':
+ elif subnet_type in ['static', 'static6']:
# grep BOOTPROTO sysconfig.txt -A2 | head -3
# BOOTPROTO=none|bootp|dhcp
# 'bootp' or 'dhcp' cause a DHCP client
@@ -419,7 +419,7 @@ class Renderer(renderer.Renderer):
continue
elif subnet_type in IPV6_DYNAMIC_TYPES:
continue
- elif subnet_type == 'static':
+ elif subnet_type in ['static', 'static6']:
if subnet_is_ipv6(subnet):
ipv6_index = ipv6_index + 1
ipv6_cidr = "%s/%s" % (subnet['address'], subnet['prefix'])