← 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):

So, previously if those files existed, but no 'ip=' on the cmdline we would not use the files.
This keeps that same behavior.

I'd rather have this internal helper method contain all logic rather than just pushing some of the logic to the caller.

> +    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:

we could. the setting of defaults is normally done at the top of functions.  i'm not terribly fussed either way.  while it does mean a call to 'glob.glob' that isn't used.

> +        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