← Back to team overview

cloud-init-dev team mailing list archive

Re: [Merge] ~smoser/cloud-init:bug/1683038-ec2-no-warn-on-explicit into cloud-init:master

 


Diff comments:

> diff --git a/cloudinit/sources/DataSourceEc2.py b/cloudinit/sources/DataSourceEc2.py
> index 2f9c7ed..818a639 100644
> --- a/cloudinit/sources/DataSourceEc2.py
> +++ b/cloudinit/sources/DataSourceEc2.py
> @@ -266,6 +267,12 @@ def parse_strict_mode(cfgval):
>      return mode, sleep
>  
>  
> +def _is_explicit_dslist(dslist):

bikeshed disclaimer:  _is_explicit_dslist is really only checking if Ec2 is explicitly configured, why not rename _is_ec2_explicit_datasource? Then there is no question about what this function does.

> +    if 'Ec2' not in dslist:

Also, is it possible that dslist comes in configured as None via either an improper "datasource_list: "  or a config.cfg that doesn't define a datasource_list at all so our (self.sys_cfg.get('datasource_list') gives us None?
If so, then our 'Ec2' in dslist check would stacktrace

> +        return False
> +    return (len(dslist) == 1 or (len(dslist) == 2 and 'None' in dslist))
> +
> +
>  def warn_if_necessary(cfgval, cfg):
>      try:
>          mode, sleep = parse_strict_mode(cfgval)


-- 
https://code.launchpad.net/~smoser/cloud-init/+git/cloud-init/+merge/324274
Your team cloud-init commiters is requested to review the proposed merge of ~smoser/cloud-init:bug/1683038-ec2-no-warn-on-explicit into cloud-init:master.


References