Invalid network config dictionaries are not handled well
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init |
Expired
|
Undecided
|
Unassigned |
Bug Description
Empty or invalid network configurations are not handled gracefully:
network:
version: 1
config: []
network:
foo: 27
wark: True
These result in errors during rendering like this:
File "/home/
network_
File "/home/
for iface in network_
AttributeError: 'NoneType' object has no attribute 'iter_interfaces'
r.render_
File "/home/
content = self._render_
File "/home/
interfaces = network_
AttributeError: 'NoneType' object has no attribute '_network_state'
It appears that cloudinit.
In general we should decide how to handle these two types of configurations (empty and invalid) and allow cloud-init to fail gracefully, for example, cloud-init could use fallback_network config in the case of an invalid supplied network configuration.
I've confirmed locally that this is still an issue, but it's not clear to me how many places might provide empty/broken configuration, so I'm not sure what the priority should be.