From a1cdebdea65ccd827060c823146992bba9debe19 Mon Sep 17 00:00:00 2001 From: LaMont Jones Date: Mon, 31 Oct 2016 21:48:44 -0600 Subject: net/cmdline: Further adjustments to ipv6 support The implementation to add ipv6 support to Ubuntu initramfs changed (see bug 1621507). The changes here adjust to handle the new path. Now, the ipv6 route includes using the variable 'DEVICE6' in net6-DEVICE.conf files. LP: #1621615 --- cloudinit/net/cmdline.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cloudinit/net/cmdline.py b/cloudinit/net/cmdline.py index 933317d5..4075a279 100644 --- a/cloudinit/net/cmdline.py +++ b/cloudinit/net/cmdline.py @@ -76,12 +76,13 @@ 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 - proto = data.get('PROTO') + # IPv6 config gives us IPV6PROTO, not PROTO. + proto = data.get('PROTO', data.get('IPV6PROTO')) if not proto: if data.get('filename'): proto = 'dhcp' -- cgit v1.2.3