cloud-init-dev team mailing list archive
-
cloud-init-dev team
-
Mailing list archive
-
Message #06207
Re: [Merge] ~rjschwei/cloud-init:triggerudev into cloud-init:master
Diff comments:
> diff --git a/cloudinit/net/sysconfig.py b/cloudinit/net/sysconfig.py
> index 0998392..5f6f2d8 100644
> --- a/cloudinit/net/sysconfig.py
> +++ b/cloudinit/net/sysconfig.py
> @@ -696,6 +696,14 @@ class Renderer(renderer.Renderer):
> if nm_conf_content:
> util.write_file(nm_conf_path, nm_conf_content, file_mode)
> if self.netrules_path:
> + # When many interfaces are present it can happen that we get here
> + # before they are all setup. Settle if that is the case.
> + for iface in network_state.iter_interfaces(
> + renderer.filter_by_physical):
> + path = net.sys_dev_path(str(iface))
> + if not os.path.exists(path):
> + util.udevadm_settle(path, 5)
> + break
Yes, a new event could block a second settle; I guess we would like some confirmation that post-settle, the set of interfaces we were looking for are now present, no?
# list of ifaces not yet present
missing = [iface for iface in network_state.iter_interfaces(renderer.filter_by_physcal)
if not os.path.exists(net.sys_dev_path(str(iface))]
if len(missing):
util.udevadm_settle(timeout=5)
if any([iface for iface in missing if not os.path.exists(net.sys_dev_path(str(iface))]):
log.warning('Some interfaces not yet present, possible badness')
And how hard should we try to wait for all physical interfaces?
> netrules_content = self._render_persistent_net(network_state)
> netrules_path = util.target_path(target, self.netrules_path)
> util.write_file(netrules_path, netrules_content, file_mode)
--
https://code.launchpad.net/~rjschwei/cloud-init/+git/cloud-init/+merge/363571
Your team cloud-init commiters is requested to review the proposed merge of ~rjschwei/cloud-init:triggerudev into cloud-init:master.
References