diff options
author | Harald Jensås <hjensas@redhat.com> | 2019-10-31 16:15:27 +0000 |
---|---|---|
committer | Server Team CI Bot <josh.powers+server-team-bot@canonical.com> | 2019-10-31 16:15:27 +0000 |
commit | fcc92ad15199318abfad067c63f5ab941addc720 (patch) | |
tree | a455e1290e9ade92052cd1cde9c71ee6490a45c8 /cloudinit | |
parent | a61ee02a50eb21954c114e01d2d042916bb2dc14 (diff) | |
download | vyos-cloud-init-fcc92ad15199318abfad067c63f5ab941addc720.tar.gz vyos-cloud-init-fcc92ad15199318abfad067c63f5ab941addc720.zip |
net: fix subnet_is_ipv6() for stateless|stateful
Function return false for ipv6_dhcpv6-stateless|stateful,
the eni renderer does not add '6' to 'inet' which is
incorrect.
The subnet_is_ipv6() function is updated to also return
true if startswith('ipv6').
LP: #1848690
Diffstat (limited to 'cloudinit')
-rw-r--r-- | cloudinit/net/network_state.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cloudinit/net/network_state.py b/cloudinit/net/network_state.py index b485f3d9..ba85c69e 100644 --- a/cloudinit/net/network_state.py +++ b/cloudinit/net/network_state.py @@ -919,8 +919,8 @@ def is_ipv6_addr(address): def subnet_is_ipv6(subnet): """Common helper for checking network_state subnets for ipv6.""" - # 'static6' or 'dhcp6' - if subnet['type'].endswith('6'): + # 'static6', 'dhcp6', 'ipv6_dhcpv6-stateful' or 'ipv6_dhcpv6-stateless' + if subnet['type'].endswith('6') or subnet['type'].startswith('ipv6'): # This is a request for DHCPv6. return True elif subnet['type'] == 'static' and is_ipv6_addr(subnet.get('address')): |