Skip to content

Commit c34b7c8

Browse files
author
Capirca Team
committed
Make the term names unique by including the address family for Arista TP.
- This is because the term names are propagated to field-sets and results in a collision when IPv4 and IPv6 policies are rendered together. PiperOrigin-RevId: 775729103
1 parent b38903c commit c34b7c8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

capirca/lib/arista_tp.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -909,8 +909,8 @@ def _TranslatePolicy(self, pol, exp_info):
909909
# appropriate default term name to be used in this filter.
910910
default_term = re.match(r"^default\-.*", term.name, re.IGNORECASE)
911911

912-
# remove if term names become unique to address family.
913-
if (filter_type == "mixed" and ft == "inet6"):
912+
# make the term names unique to address family.
913+
if ft == "inet6":
914914
term.name = af_map_txt[ft] + "-" + term.name
915915

916916
if default_term:

tests/lib/arista_tp_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1154,7 +1154,7 @@ def testIcmpInet6Mismatch(self, mock_debug):
11541154
str(atp)
11551155

11561156
mock_debug.assert_called_once_with(
1157-
"Term icmptype-mismatch will not be rendered, "
1157+
"Term ipv6-icmptype-mismatch will not be rendered, "
11581158
"as it has icmp match specified but "
11591159
"the ACL is of inet6 address family.")
11601160

0 commit comments

Comments
 (0)