Comment 10 for bug 1508115

Revision history for this message
Zane Bitter (zaneb) wrote :

The update code starts making a lot more sense when you think of it in terms of where the nodes in the update graph come from (see https://github.com/zaneb/presentations/blob/heat-workflow/update.svg). So _process_new_resource_update() processes a node contributed by the new template's graph, and first attempts to co-opt an existing resource (by updating it in place) or, failing that, falls back to creating the new one. Similarly, _process_existing_resource_update() processes a node contributed by the existing template's (reversed) graph, so it does nothing unless there is a replaced resource that needs to be cleaned up. I'd be all for changing the names if you can think of better ones.

In any event, as you've discovered. all of the logic we want already exists and the fix to this problem is a simple (ha!) matter of figuring out which values to compare in a single line of code.