Public bug reported:

cloud-init master using net-convert, we can see that the bond
configuration is not complete with the following input network
configuration


% cat bonding.yaml
network:
    version: 1
    config:
        - type: physical
          name: interface0
          mac_address: "52:54:00:12:34:00"
          subnets:
              - type: dhcp4
        - type: physical
          name: interface1
          mac_address: "52:54:00:12:34:02"
        - type: physical
          name: interface2
          mac_address: "52:54:00:12:34:04"
        - type: bond
          name: bond0
          mac_address: "52:54:00:12:34:06"
          bond_interfaces:
            - interface1
            - interface2
          params:
            bond-mode: active-backup
          subnets:
              - type: static
                address: 10.23.23.2/24
              - type: static
                address: 10.23.24.2/24

% Traceback (most recent call last):
  File "./tools/net-convert.py", line 82, in <module>
    main()
  File "./tools/net-convert.py", line 78, in main
    r.render_network_state(ns, target=args.directory)
  File "/home/rharper/work/git/cloud-init/cloudinit/net/sysconfig.py", line 
501, in render_network_state
    network_state).items():
  File "/home/rharper/work/git/cloud-init/cloudinit/net/sysconfig.py", line 
479, in _render_sysconfig
    cls._render_physical_interfaces(network_state, iface_contents)
  File "/home/rharper/work/git/cloud-init/cloudinit/net/sysconfig.py", line 
406, in _render_physical_interfaces
    cls._render_subnets(iface_cfg, iface_subnets)
  File "/home/rharper/work/git/cloud-init/cloudinit/net/sysconfig.py", line 
272, in _render_subnets
    for i, subnet in enumerate(subnets, start=len(iface_cfg.children)):
TypeError: 'NoneType' object is not iterable


Even with small fixes to handle empty subnets or routes, the current 
_render_bond_interfaces doesn't write out the required bonding key value pairs.

** Affects: cloud-init
     Importance: Undecided
         Status: New


** Tags: centos7

-- 
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/1695066

Title:
  sysconfig doesn't render bond configurations correctly

Status in cloud-init:
  New

Bug description:
  cloud-init master using net-convert, we can see that the bond
  configuration is not complete with the following input network
  configuration

  
  % cat bonding.yaml
  network:
      version: 1
      config:
          - type: physical
            name: interface0
            mac_address: "52:54:00:12:34:00"
            subnets:
                - type: dhcp4
          - type: physical
            name: interface1
            mac_address: "52:54:00:12:34:02"
          - type: physical
            name: interface2
            mac_address: "52:54:00:12:34:04"
          - type: bond
            name: bond0
            mac_address: "52:54:00:12:34:06"
            bond_interfaces:
              - interface1
              - interface2
            params:
              bond-mode: active-backup
            subnets:
                - type: static
                  address: 10.23.23.2/24
                - type: static
                  address: 10.23.24.2/24

  % Traceback (most recent call last):
    File "./tools/net-convert.py", line 82, in <module>
      main()
    File "./tools/net-convert.py", line 78, in main
      r.render_network_state(ns, target=args.directory)
    File "/home/rharper/work/git/cloud-init/cloudinit/net/sysconfig.py", line 
501, in render_network_state
      network_state).items():
    File "/home/rharper/work/git/cloud-init/cloudinit/net/sysconfig.py", line 
479, in _render_sysconfig
      cls._render_physical_interfaces(network_state, iface_contents)
    File "/home/rharper/work/git/cloud-init/cloudinit/net/sysconfig.py", line 
406, in _render_physical_interfaces
      cls._render_subnets(iface_cfg, iface_subnets)
    File "/home/rharper/work/git/cloud-init/cloudinit/net/sysconfig.py", line 
272, in _render_subnets
      for i, subnet in enumerate(subnets, start=len(iface_cfg.children)):
  TypeError: 'NoneType' object is not iterable

  
  Even with small fixes to handle empty subnets or routes, the current 
_render_bond_interfaces doesn't write out the required bonding key value pairs.

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

-- 
Mailing list: https://launchpad.net/~yahoo-eng-team
Post to     : yahoo-eng-team@lists.launchpad.net
Unsubscribe : https://launchpad.net/~yahoo-eng-team
More help   : https://help.launchpad.net/ListHelp

Reply via email to