← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~larsks/cloud-init:bz/1542578 into cloud-init:master

 

I agree re: refactoring, but I'm not sure I'm up to that right now.  I'll make the changes you suggested and I'll add a test or two.

Diff comments:

> diff --git a/cloudinit/config/cc_mounts.py b/cloudinit/config/cc_mounts.py
> index f14a4fc..c0d5029 100644
> --- a/cloudinit/config/cc_mounts.py
> +++ b/cloudinit/config/cc_mounts.py
> @@ -336,12 +352,17 @@ def handle(_name, cfg, cloud, log, _args):
>  
>          start = str(cfgmnt[i][0])
>          sanitized = sanitize_devname(start, cloud.device_name_to_device, log)
> +        if sanitized != start:
> +            log.debug("changed %s => %s" % (start, sanitized))
> +
>          if sanitized is None:
> -            log.debug("Ignorming nonexistant named mount %s", start)
> +            log.debug("Ignoring nonexistant named mount %s", start)
> +            continue
> +        elif sanitized in fstab_devs:
> +            log.warn("Device %s already defined in fstab: %s",
> +                     sanitized, fstab_devs[sanitized])

I figured "warn" because this means -- maybe -- that something you expected to happen because of your cloudinit configuration was not going to happen because of the system configuration. But I am happy to change it.

>              continue
>  
> -        if sanitized != start:
> -            log.debug("changed %s => %s" % (start, sanitized))
>          cfgmnt[i][0] = sanitized
>  
>          # in case the user did not quote a field (likely fs-freq, fs_passno)


-- 
https://code.launchpad.net/~larsks/cloud-init/+git/cloud-init/+merge/345113
Your team cloud-init commiters is requested to review the proposed merge of ~larsks/cloud-init:bz/1542578 into cloud-init:master.


References