← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~daniel-thewatkins/cloud-init/+git/cloud-init:feature/cc-uaclient into cloud-init:master

 

This is a re-submission of Chad's branch (which was previously reviewed at https://code.launchpad.net/~chad.smith/cloud-init/+git/cloud-init/+merge/362161).  I've addressed much of the review feedback there (generally in separate commits, so review my new commits to understand the changes I've made); the remaining unaddressed item I have inserted inline here for discussion.

Diff comments:

> diff --git a/cloudinit/config/cc_ubuntu_advantage.py b/cloudinit/config/cc_ubuntu_advantage.py
> index 5e082bd..9732ffa 100644
> --- a/cloudinit/config/cc_ubuntu_advantage.py
> +++ b/cloudinit/config/cc_ubuntu_advantage.py
> @@ -159,14 +134,26 @@ def maybe_install_ua_tools(cloud):
>  
>  
>  def handle(name, cfg, cloud, log, args):
> -    cfgin = cfg.get('ubuntu-advantage')
> -    if cfgin is None:
> +    if 'ubuntu-advantage' in cfg:
> +        msg = ('Deprecated configuration key "ubuntu-advantage" provided.'

Ryan said:
> do we really want to raise runtime error on deprecated config?
> I think logging a warning and doing the ua attach is a better outcome, right?

> +               ' Expected underscore delimited "ubuntu_advantage"')
> +        LOG.error(msg)
> +        raise RuntimeError(msg)
> +    ua_section = cfg.get('ubuntu_advantage')
> +    if ua_section is None:
>          LOG.debug(("Skipping module named %s,"
> -                   " no 'ubuntu-advantage' key in configuration"), name)
> +                   " no 'ubuntu_advantage' configuration found"), name)
>          return
> -
>      validate_cloudconfig_schema(cfg, schema)
> +    if 'commands' in ua_section:
> +        msg = (
> +            'Deprecated configuration "ubuntu_advantage: commands" provided.'
> +            ' Expected "token"')
> +        LOG.error(msg)
> +        raise RuntimeError(msg)
> +
>      maybe_install_ua_tools(cloud)
> -    run_commands(cfgin.get('commands', []))
> +    configure_ua(token=ua_section.get('token'),
> +                 entitlements=ua_section.get('entitlements'))
>  
>  # vi: ts=4 expandtab


-- 
https://code.launchpad.net/~daniel-thewatkins/cloud-init/+git/cloud-init/+merge/365366
Your team cloud-init commiters is requested to review the proposed merge of ~daniel-thewatkins/cloud-init/+git/cloud-init:feature/cc-uaclient into cloud-init:master.


Follow ups