cloudinit/net/sysconfig.py does not parse network_data.json correctly

Bug #1665441 reported by Lars Kellogg-Stedman
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init
Fix Released
Medium
Lars Kellogg-Stedman

Bug Description

In cloudinit/net/sysconfig.py, we see:

            elif len(iface_subnets) > 1:
                for i, iface_subnet in enumerate(iface_subnets,
                                                 start=len(iface.children)):
                    iface_sub_cfg = iface_cfg.copy()
                    iface_sub_cfg.name = "%s:%s" % (iface_name, i)
                    iface.children.append(iface_sub_cfg)
                    cls._render_subnet(iface_sub_cfg, route_cfg, iface_subnet)

The code 'start=len(iface.children)' fails because at this point, iface is simply a dict, and has no 'children' attribute.

Related branches

Revision history for this message
Lars Kellogg-Stedman (larsks) wrote :
Revision history for this message
Lars Kellogg-Stedman (larsks) wrote :

I am working on a fix in https://code.launchpad.net/~larsks/cloud-init/+git/cloud-init/+ref/lp/1665441. That branch right now will run without errors but the resulting config file appears to be missing an ip address.

Revision history for this message
Lars Kellogg-Stedman (larsks) wrote :

I've gone ahead and proposed the fix for merging. It results in interface config files that are correct but that will only work with legacy (pre-NetworkManager) networking until https://cgit.freedesktop.org/NetworkManager/NetworkManager/commit/?id=a8f0d88596d8dd2b807a7b0adee272c4f077dade reaches centos/rhel/etc packaging.

Changed in cloud-init:
assignee: nobody → Lars Kellogg-Stedman (larsks)
status: New → Confirmed
Changed in cloud-init:
status: Confirmed → Fix Committed
Scott Moser (smoser)
Changed in cloud-init:
importance: Undecided → Medium
Revision history for this message
Scott Moser (smoser) wrote : Fixed in Cloud-init 17.1

This bug is believed to be fixed in cloud-init in 17.1. If this is still a problem for you, please make a comment and set the state back to New

Thank you.

Changed in cloud-init:
status: Fix Committed → Fix Released
Revision history for this message
James Falcon (falcojr) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.