← Back to team overview

cloud-init-dev team mailing list archive

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

 


Diff comments:

> 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')

Can we just do:
  proto = data.get('PROTO', data.get('PROTO6'))
And then we dont have to change the following lines at all.

>      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)


-- 
https://code.launchpad.net/~lamont/cloud-init/+git/bug-1621615-device6/+merge/309718
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.


Follow ups

References