Skip to content

Commit

Permalink
Do not set VRF assign rules for right interfaces of nat instances
Browse files Browse the repository at this point in the history
We are planning not to link service RI with the primary RI of the
right networks of in-network-nat instances. We should also not
set VRF assign rules.

Change-Id: I11ad075a2d91e5da18094612a2c5935366197c94
Partial-Bug: 1554175
Related-Bug: 1562200
  • Loading branch information
Sachin Bansal committed Apr 6, 2016
1 parent b3ceb5a commit 0354c2b
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/config/schema-transformer/config_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -3247,8 +3247,10 @@ def recreate_vrf_assign_table(self):
if vn is None:
return
vm_pt = self.get_virtual_machine_or_port_tuple()
if not vm_pt or vm_pt.get_service_mode() not in ['in-network',
'in-network-nat']:
if not vm_pt:
return
smode = vm_pt.get_service_mode()
if smode not in ['in-network', 'in-network-nat']:
return

vrf_table = VrfAssignTableType()
Expand Down Expand Up @@ -3279,7 +3281,12 @@ def recreate_vrf_assign_table(self):

policy_rule_count = 0
si_name = vm_pt.service_instance
for service_chain_list in vn.service_chains.values():
if smode == 'in-network-nat' and self.service_interface_type == 'right':
vn_service_chains = []
else:
vn_service_chains = vn.service_chains.values()

for service_chain_list in vn_service_chains:
for service_chain in service_chain_list:
if not service_chain.created:
continue
Expand All @@ -3292,10 +3299,9 @@ def recreate_vrf_assign_table(self):
dst_port=dp,
protocol=service_chain.protocol)

vrf_rule = VrfAssignRuleType(
match_condition=mc,
routing_instance=ri_name,
ignore_acl=True)
vrf_rule = VrfAssignRuleType(match_condition=mc,
routing_instance=ri_name,
ignore_acl=True)
vrf_table.add_vrf_assign_rule(vrf_rule)
policy_rule_count += 1
# end for service_chain
Expand Down

0 comments on commit 0354c2b

Please sign in to comment.