cloud-init-dev team mailing list archive
-
cloud-init-dev team
-
Mailing list archive
-
Message #06545
Re: [Merge] ~daniel-thewatkins/cloud-init/+git/cloud-init:dracut into cloud-init:master
Diff comments:
> diff --git a/cloudinit/net/cmdline.py b/cloudinit/net/cmdline.py
> index 556a10f..c05d36c 100755
> --- a/cloudinit/net/cmdline.py
> +++ b/cloudinit/net/cmdline.py
> @@ -137,6 +203,24 @@ def config_from_klibc_net_cfg(files=None, mac_addrs=None):
> return {'config': entries, 'version': 1}
>
>
> +def read_initramfs_config():
> + """
> + Return v1 network config for initramfs-configured networking (or None)
OK.
> +
> + This will consider each _INITRAMFS_CONFIG_SOURCES entry in turn, and return
> + v1 network configuration for the first one that is applicable. If none are
> + applicable, return None.
> + """
> + for src_cls in _INITRAMFS_CONFIG_SOURCES:
I see it now. You're right. I wonder if the the command line bits ought to be factored out of the "am I klibc, or dracut or. ..." path? Checking if the commandline has ip= is duplicate code between initramfs applicables, as will the open-iscsi check, the only things that are initramfs format specific are the file locations they know about. Maybe a base class implementation with the common bits ?
> + cfg_source = src_cls()
> +
> + if not cfg_source.is_applicable():
> + continue
> +
> + return cfg_source.render_config()
> + return None
> +
> +
> def _decomp_gzip(blob, strict=True):
> # decompress blob. raise exception if not compressed unless strict=False.
> with io.BytesIO(blob) as iobuf:
--
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/371673
Your team cloud-init commiters is requested to review the proposed merge of ~daniel-thewatkins/cloud-init/+git/cloud-init:dracut into cloud-init:master.
References