← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1685927] Re: cloud-init network v2 config loses some settings when rendered

 

** Also affects: cloud-init
   Importance: Undecided
       Status: New

** Changed in: cloud-init
       Status: New => Confirmed

** Changed in: cloud-init (Ubuntu)
       Status: New => Confirmed

** Changed in: cloud-init
   Importance: Undecided => Medium

** Changed in: cloud-init (Ubuntu)
   Importance: Undecided => Medium

** Changed in: cloud-init
       Status: Confirmed => Triaged

** Changed in: cloud-init (Ubuntu)
       Status: Confirmed => Triaged

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to cloud-init.
https://bugs.launchpad.net/bugs/1685927

Title:
  cloud-init network v2 config loses some settings when rendered

Status in cloud-init:
  Triaged
Status in cloud-init package in Ubuntu:
  Triaged

Bug description:
  Running a v2 network-config through cloud-init's net-convert we can
  see that we're not passing it through, but importing and re-rendering
  lossy.

  % cat simple-v2.yaml 
  network:
    version: 2
    # comment above ethernets
    ethernets:
        ens0:
           dhcp4: true
           match:
             macaddress: 00:11:22:33:44:55
           set-name: ens0
        switchports:
          # all cards on second PCI bus; unconfigured by themselves, will be added
          # to br0 below
          match:
            name: enp2*
          mtu: 1280

  % PYTHONPATH=`pwd` ./tools/net-convert.py --network-data
  simple-v2.yaml --kind yaml --output-kind netplan -d target

  % cat target/etc/netplan/50-cloud-init.yaml

  network:
      version: 2
      ethernets:
          ens0:
              dhcp4: true
          switchports:
              mtu: 1280

  We lose comments and matching.

  Also note, ./tools/net-convert.py has a bug, the order of parameters
  to the rendering class changed.

  % git diff tools/net-convert.py 
  diff --git a/tools/net-convert.py b/tools/net-convert.py
  index 870da63..ec4ee64 100755
  --- a/tools/net-convert.py
  +++ b/tools/net-convert.py
  @@ -75,7 +75,7 @@ def main():
           r_cls = sysconfig.Renderer
   
       r = r_cls()
  -    r.render_network_state(ns, target=args.directory)
  +    r.render_network_state(args.directory, ns)
   
   
   if __name__ == '__main__':

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-init/+bug/1685927/+subscriptions