Comment 0 for bug 1626630

Zane Bitter (zaneb) wrote :

(Note that bug 1626607 should be fixed before attempting this one.)

If the Router is created in the template (as opposed to being passed in as a parameter) then the `router_id` properties resolve to None prior to the resource being created. Therefore they always match, and every RouterGateway ends up depending on every RouterInterface.

(Prior to convergence, the dependencies were re-resolved for a delete or update and would be correct from that point on. However, in convergence phase 1 dependencies are written to the database before creating the stack and we use those ones to do a subsequent update or delete.)

It's undesirable (though apparently not fatal) to have such broad dependencies.

Two possible solutions present themselves. One is to stop returning None as a placeholder during creates and instead return some kind of object that we can infer data about. We talked about this at the Newton summit, but haven't yet done any work on it. We didn't talk about using this mechanism to infer dependencies (rather than just types), but it's probably a straightforward extension of the concept.

The alternative solution would have to use a combination of property values when they are non-null and the dependencies of the individual properties when the values are None to handle both the get_param and the get_resource cases. That is to say we would do something like function.dependencies(rsrc.properties.data.get('router_id')) and see if the router resource we're looking for is in there.

See further discussion in https://review.openstack.org/#/c/289371/ for context.