cloud-init-dev team mailing list archive
-
cloud-init-dev team
-
Mailing list archive
-
Message #02232
Re: [Merge] ~smoser/cloud-init:bug/1683038-ec2-no-warn-on-explicit into cloud-init:master
Generally looks fine, one question w.r.t confirming explict_dslist check
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):
> + if 'Ec2' not in dslist:
> + return False
> + return (len(dslist) == 1 or (len(dslist) == 2 and 'None' in dslist))
if we know dslist is len == 2, then We could ensure it looks like:
['Ec2', None]
Right? That's exactly what we're looking for? Verus this [None, 'Ec2'] which would pass this test but not be what we're looking for IIUC
> +
> +
> 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.
Follow ups
References