← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~smoser/cloud-init:bug/1752391-fix-iscsi-root-without-ip into cloud-init:master

 


Diff comments:

> diff --git a/cloudinit/net/cmdline.py b/cloudinit/net/cmdline.py
> index 7b2cc9d..a123afb 100755
> --- a/cloudinit/net/cmdline.py
> +++ b/cloudinit/net/cmdline.py
> @@ -160,10 +167,23 @@ def _b64dgz(b64str, gzipped="try"):
>      return _decomp_gzip(blob, strict=gzipped != "try")
>  
>  
> +def _is_initramfs_netconfig(files, cmdline):

Do we really need to check ip=, ip6, or file OPEN_ISCSI_INTERFACE_FILE if we have files results?
Would we have ip= and no files? etc.

If we want to exit early without globbing then we could instead do:

if 'ip=' in cmdline or 'ip6' in cmdline or os.path.exists(_ISCSI_FILE):
    return _get_kblic_cfg_files()
return []

Then the caller, read_kernel_cmdline, can do this to
see if there is a configuration to process.

files = _is_initramfs_netconfig(cmdline)
if not files:
    return None

> +    if files:
> +        if 'ip=' in cmdline or 'ip6' in cmdline:
> +            return True
> +        if os.path.exists(_OPEN_ISCSI_INTERFACE_FILE):
> +            # iBft can configure networking without ip=
> +            return True
> +    return False
> +
> +
>  def read_kernel_cmdline_config(files=None, mac_addrs=None, cmdline=None):
>      if cmdline is None:
>          cmdline = util.get_cmdline()
>  
> +    if files is None:

This can move below the 'network-config' section; it's not used if we find a network-config in cmdline.

> +        files = _get_klibc_net_cfg_files()
> +
>      if 'network-config=' in cmdline:
>          data64 = None
>          for tok in cmdline.split():


-- 
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/340140
Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:bug/1752391-fix-iscsi-root-without-ip into cloud-init:master.


References