While investigating https://bugs.launchpad.net/group-based-policy/+bug/1509458, I discovered that GroupPolicyDbPlugin._set_ess_for_l3p() gets called six times during creation of an L3Policy with an implicit ExternalSegment, and that two different IP addresses get passed to it for the same L3Policy. I filed https://bugs.launchpad.net/group-based-policy/+bug/1522554 to cover duplicate calls to _set_ess_for_l3p() originating from create_l3_policy_postcommit() and update_l3_policy_postcommit(). This bug addresses the unnecessary calls to _set_ess_for_l3p() resulting from ApicMappingDriver._plug_l3p_to_es() recursively calling itself to process shadow L3-outs. When called recursively, with is_shadow=True, it should not call L3PolicyContext.set_external_fixed_ips(), which results in an unnecessary call to _set_ess_for_l3p().
Reviewed: https:/ /review. openstack. org/254360 /git.openstack. org/cgit/ openstack/ group-based- policy/ commit/ ?id=d710a82b510 a00ad897cfdd1cd 5365996a31cdb9
Committed: https:/
Submitter: Jenkins
Branch: master
commit d710a82b510a00a d897cfdd1cd5365 996a31cdb9
Author: Amit Bose <email address hidden>
Date: Mon Dec 7 11:48:22 2015 -0800
[APIC mapping] Set external IP for L3Policy only once
Remove the redundant call to set external fixed-IP
for the L3Policy when creating shadow L3Out on APIC.
Closes-Bug: 1522613
Change-Id: I0b92e0497fd1fb efc8c6e89892f20 523b3c3ad43
Signed-off-by: Amit Bose <email address hidden>