Merge lp://staging/~harlowja/cloud-init/launch-index-work into lp://staging/~cloud-init-dev/cloud-init/trunk

Proposed by Scott Moser
Status: Merged
Merged at revision: 642
Proposed branch: lp://staging/~harlowja/cloud-init/launch-index-work
Merge into: lp://staging/~cloud-init-dev/cloud-init/trunk
Diff against target: 365 lines (+196/-29)
8 files modified
cloudinit/cloud.py (+6/-2)
cloudinit/filters/__init__.py (+21/-0)
cloudinit/filters/launch_index.py (+75/-0)
cloudinit/sources/DataSourceEc2.py (+6/-0)
cloudinit/sources/__init__.py (+25/-3)
cloudinit/stages.py (+1/-1)
cloudinit/user_data.py (+54/-18)
cloudinit/util.py (+8/-5)
To merge this branch: bzr merge lp://staging/~harlowja/cloud-init/launch-index-work
Reviewer Review Type Date Requested Status
cloud-init Commiters Pending
Review via email: mp+121423@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Scott Moser (smoser) wrote :

Josh,
 Thanks for the work, it looks pretty good. I have a few comments:
 * why CAN_HAVE_LAUNCH_INDEX ?
   why do we want to limit which parts can affect only a given launch index.
 * https://review.openstack.org/#/c/11997/ will add 'launch_index' to the openstack metadata service. I suggest we make the getter for launch_index a default in DataSource and let ec2 override it. The default would look for 'launch_index' or 'launch-index' in metadata and return None if not found.

Revision history for this message
Joshua Harlow (harlowja) wrote :

> Josh,
> Thanks for the work, it looks pretty good. I have a few comments:
> * why CAN_HAVE_LAUNCH_INDEX ?
> why do we want to limit which parts can affect only a given launch index.
> * https://review.openstack.org/#/c/11997/ will add 'launch_index' to the
> openstack metadata service. I suggest we make the getter for launch_index a
> default in DataSource and let ec2 override it. The default would look for
> 'launch_index' or 'launch-index' in metadata and return None if not found.

So CAN_HAVE_LAUNCH_INDEX is more of just a filter that restricts whether we will look into there payload to see if it has a 'yaml' body that has a key 'launch-index', the individual parts can still provide there own 'Launch-Index' header (since it seems bad to scrap all content that might not be yaml). That seems to make sense, although it can be disabled if we want.

As far as the getter, can do, let me make it a property that does that.

639. By Joshua Harlow

Update so that the content types searched for launch-index
variable has a little more meaning and by default look in
metadata for 'launch-index' and have ec2 instead look for
a different variable (thus allowing more datasources to just work).

640. By Joshua Harlow

For the userdata 'post-filtering' add in a new folder that
can contain filters that serve this purpose only and add in
the initial launch-index filter and replace the code in
the datasource class that previously did this.

641. By Joshua Harlow

Don't use walk and handle the walking ourselves to
ensure that we recreate all child messages correctly
if they also contain submessages, ensuring that
we don't flatten the message list when we previously
used walk.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.