init-local fails with network: config: disabled from NoCloud datasource.

Bug #1679602 reported by Witold Krecicki
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
cloud-init
Expired
Undecided
Unassigned

Bug Description

When passing network-config "network: config: disabled" via NoCloud I'm getting the following error in cloud-init.log:

2017-04-04 10:08:01,021 - stages.py[INFO]: Applying network configuration from ds bringup=False: {'network': {'config': 'disabled'}}
2017-04-04 10:08:01,021 - util.py[WARNING]: failed stage init-local
2017-04-04 10:08:01,021 - util.py[DEBUG]: failed stage init-local
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 647, in status_wrapper
    ret = functor(name, args)
  File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 365, in main_init
    init.apply_network_config(bring_up=bool(mode != sources.DSMODE_LOCAL))
  File "/usr/lib/python3/dist-packages/cloudinit/stages.py", line 648, in apply_network_config
    return self.distro.apply_network_config(netcfg, bring_up=bring_up)
  File "/usr/lib/python3/dist-packages/cloudinit/distros/__init__.py", line 150, in apply_network_config
    dev_names = self._write_network_config(netconfig)
  File "/usr/lib/python3/dist-packages/cloudinit/distros/debian.py", line 84, in _write_network_config
    self._net_renderer.render_network_state("/", ns)
  File "/usr/lib/python3/dist-packages/cloudinit/net/eni.py", line 451, in render_network_state
    util.write_file(fpeni, header + self._render_interfaces(network_state))
  File "/usr/lib/python3/dist-packages/cloudinit/net/eni.py", line 409, in _render_interfaces
    for iface in network_state.iter_interfaces():
AttributeError: 'NoneType' object has no attribute 'iter_interfaces'

Revision history for this message
Scott Moser (smoser) wrote :

I'm pretty sure this will work if you provide it with a network-config file of:
config: disabled

The top level 'network' does not need to be repeated in the 'network-config' file as it is assumed to be network config due to its anme.

I've just tested in an lxc container doing:

echo "config: disabled" > /var/lib/cloud/seed/nocloud-net/network-config

if that doesnt fix the problem, please set Status back to New.

summary: - init-local fails with network: config: disabled.
+ init-local fails with network: config: disabled from NoCloud datasource.
Changed in cloud-init:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for cloud-init because there has been no activity for 60 days.]

Changed in cloud-init:
status: Incomplete → Expired
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.

Other bug subscribers

Remote bug watches

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