Merge "NSXV Octavia: handle listener update with l7policy" into stable/xena

This commit is contained in:
Zuul 2022-08-26 18:22:28 +00:00 committed by Gerrit Code Review
commit c72cad135f
3 changed files with 16 additions and 14 deletions

View File

@ -458,8 +458,8 @@ class ApiReplayClient(utils.PrepareObjectForMigration):
# make sure all the security group rules are there and
# create them if not
for sg_rule in sg['security_group_rules']:
if(self.have_id(sg_rule['id'],
dest_sec_group['security_group_rules'])
if (self.have_id(sg_rule['id'],
dest_sec_group['security_group_rules'])
is False):
try:
rule_start = datetime.now()

View File

@ -1179,11 +1179,11 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
with db_api.CONTEXT_READER.using(context):
network = self._get_network(context, net_id)
for subnet in network.subnets:
if(subnet.enable_dhcp and
(subnet.ip_version == 4 or
subnet.ipv6_address_mode != const.IPV6_SLAAC)):
if (subnet.enable_dhcp and
(subnet.ip_version == 4 or
subnet.ipv6_address_mode != const.IPV6_SLAAC)):
if (deleted_dhcp_subnets and
subnet.id in deleted_dhcp_subnets):
subnet.id in deleted_dhcp_subnets):
# Skip this one as it is being deleted
continue
dhcp_subnets.append(self.get_subnet(context, subnet.id))
@ -1272,9 +1272,9 @@ class NsxPolicyPlugin(nsx_plugin_common.NsxPluginV3Base):
net_dhcp_subnets = []
net_obj = self._get_network(context, net_id)
for subnet in net_obj.subnets:
if(subnet.enable_dhcp and
(subnet.ip_version == 4 or
subnet.ipv6_address_mode != const.IPV6_SLAAC)):
if (subnet.enable_dhcp and
(subnet.ip_version == 4 or
subnet.ipv6_address_mode != const.IPV6_SLAAC)):
# This is a DHCP subnet
net_dhcp_subnets.append(subnet.id)
return net_dhcp_subnets

View File

@ -102,11 +102,13 @@ def listener_to_edge_vse(context, listener, vip_address, default_pool,
if listener['l7_policies']:
app_rule_ids = []
for pol in listener['l7_policies']:
binding = nsxv_db.get_nsxv_lbaas_l7policy_binding(
context.session, pol['id'])
if binding:
app_rule_ids.append(binding['edge_app_rule_id'])
vse['applicationRuleId'] = app_rule_ids
pol_id = pol.get('id', pol.get('l7policy_id'))
if pol_id:
binding = nsxv_db.get_nsxv_lbaas_l7policy_binding(
context.session, pol_id)
if binding:
app_rule_ids.append(binding['edge_app_rule_id'])
vse['applicationRuleId'] = app_rule_ids
return vse