← Back to team overview

cloud-init-dev team mailing list archive

[Merge] ~lamont/cloud-init/+git/bug-1621615-device6:master into cloud-init:master

 

LaMont Jones has proposed merging ~lamont/cloud-init/+git/bug-1621615-device6:master into cloud-init:master.

Commit message:
Add support for 'DEVICE6' and /run/net6-${DEVICE6}.conf

Requested reviews:
  cloud init development team (cloud-init-dev)
Related bugs:
  Bug #1621615 in cloud-init: "network not configured when ipv6 netbooted into cloud-init"
  https://bugs.launchpad.net/cloud-init/+bug/1621615

For more details, see:
https://code.launchpad.net/~lamont/cloud-init/+git/bug-1621615-device6/+merge/309718

Fixing the original regression in initramfs-tools introduced 'DEVICE6' for IPv6 configuration, as well as /run/net6-${DEVICE6}.conf.  This addresses those changes, and is needed for (at least) yakkety to work under MAAS.
-- 
Your team cloud init development team is requested to review the proposed merge of ~lamont/cloud-init/+git/bug-1621615-device6:master into cloud-init:master.
diff --git a/cloudinit/net/cmdline.py b/cloudinit/net/cmdline.py
index 933317d..6f1e65b 100644
--- a/cloudinit/net/cmdline.py
+++ b/cloudinit/net/cmdline.py
@@ -76,17 +76,20 @@ def _klibc_to_config_entry(content, mac_addrs=None):
 
     data = _load_shell_content(content)
     try:
-        name = data['DEVICE']
+        name = data['DEVICE'] if 'DEVICE' in data else data['DEVICE6']
     except KeyError:
-        raise ValueError("no 'DEVICE' entry in data")
+        raise ValueError("no 'DEVICE' or 'DEVICE6' entry in data")
 
     # ipconfig on precise does not write PROTO
+    # IPv6 config gives us IPV6PROTO, not PROTO.
     proto = data.get('PROTO')
     if not proto:
-        if data.get('filename'):
-            proto = 'dhcp'
-        else:
-            proto = 'static'
+        proto = data.get('IPV6PROTO')
+        if not proto:
+            if data.get('filename'):
+                proto = 'dhcp'
+            else:
+                proto = 'static'
 
     if proto not in ('static', 'dhcp', 'dhcp6'):
         raise ValueError("Unexpected value for PROTO: %s" % proto)

References