Comment 1 for bug 1522554

Revision history for this message
Amit Bose (bose) wrote :

> the implicit_policy driver is updating the L3P with the ES during its create_l3_policy_postcommit() by doing an update_l3_policy(), and this results in the apic_mapping driver's update_l3_policy_postcommit() running for the L3P before it's create_l3_policy_postcommit() runs.

This behavior of the implicit policy driver seems incorrect to me, for example an "update" call is made to the backend driver before a "create" call for a resource. Besides, it affects all backend drivers, including the resource-mapping driver. So instead of working around it in every backend driver, I'm proposing to fix it in implicit-policy driver by doing following in L3PolicyContext.set_external_segment()

* Don't call GroupPolicyPlugin.update_l3_policy(); instead, update the DB to add an association between the L3Policy and 'default' external-segment
* As before, update the L3PolicyContext with 'default' external-segment ID

Doing this will ensure that before the create post-commit of the backend drivers is called, both the context and DB will be set up in a way that would be the same as when the create L3Policy request referred to 'default' external segment.