Skip to content

Commit 231d309

Browse files
authored
Generate interface table to have an entry designated to default VRF. (#2848)
* Generate default VRF table for router interfaces * Updated jinja2 template to have prefix filter
1 parent 708999a commit 231d309

File tree

18 files changed

+65
-47
lines changed

18 files changed

+65
-47
lines changed

dockers/docker-dhcp-relay/docker-dhcp-relay.supervisord.conf.j2

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ isc-dhcp-relay-{{ vlan_name }}
4949
{# We treat this VLAN as a downstream interface (-id), as we only want to listen for requests #}
5050
command=/usr/sbin/dhcrelay -d -m discard -a %%h:%%p %%P --name-alias-map-file /tmp/port-name-alias-map.txt -id {{ vlan_name }}
5151
{#- We treat all other interfaces as upstream interfaces (-iu), as we only want to listen for replies #}
52-
{% for (name, prefix) in VLAN_INTERFACE %}
52+
{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %}
5353
{% if prefix | ipv4 and name != vlan_name %} -iu {{ name }}{% endif -%}
5454
{% endfor %}
55-
{% for (name, prefix) in INTERFACE %}
55+
{% for (name, prefix) in INTERFACE|pfx_filter %}
5656
{% if prefix | ipv4 %} -iu {{ name }}{% endif -%}
5757
{% endfor %}
58-
{% for (name, prefix) in PORTCHANNEL_INTERFACE %}
58+
{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %}
5959
{% if prefix | ipv4 %} -iu {{ name }}{% endif -%}
6060
{% endfor %}
6161
{% for dhcp_server in VLAN[vlan_name]['dhcp_servers'] %} {{ dhcp_server }}{% endfor %}

dockers/docker-dhcp-relay/wait_for_intf.sh.j2

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ function wait_until_iface_ready
2929

3030

3131
# Wait for all interfaces to be up and ready
32-
{% for (name, prefix) in INTERFACE %}
32+
{% for (name, prefix) in INTERFACE|pfx_filter %}
3333
wait_until_iface_ready ${PORT_TABLE_PREFIX} {{ name }}
3434
{% endfor %}
35-
{% for (name, prefix) in VLAN_INTERFACE %}
35+
{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %}
3636
wait_until_iface_ready ${VLAN_TABLE_PREFIX} {{ name }}
3737
{% endfor %}
38-
{% for (name, prefix) in PORTCHANNEL_INTERFACE %}
38+
{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %}
3939
wait_until_iface_ready ${LAG_TABLE_PREFIX} {{ name }}
4040
{% endfor %}

dockers/docker-fpm-frr/bgpd.conf.j2

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
2929
no bgp default ipv4-unicast
3030
bgp graceful-restart restart-time 240
3131
bgp graceful-restart
32-
{% for (name, prefix) in LOOPBACK_INTERFACE %}
32+
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
3333
{% if prefix | ipv4 and name == 'Loopback0' %}
3434
bgp router-id {{ prefix | ip }}
3535
{% endif %}
3636
{% endfor %}
3737
{# advertise loopback #}
38-
{% for (name, prefix) in LOOPBACK_INTERFACE %}
38+
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
3939
{% if prefix | ipv4 and name == 'Loopback0' %}
4040
network {{ prefix | ip }}/32
4141
{% elif prefix | ipv6 and name == 'Loopback0' %}
@@ -47,7 +47,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
4747
{% endblock bgp_init %}
4848
{% endif %}
4949
{% block vlan_advertisement %}
50-
{% for (name, prefix) in VLAN_INTERFACE %}
50+
{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %}
5151
{% if prefix | ipv4 %}
5252
network {{ prefix }}
5353
{% elif prefix | ipv6 %}
@@ -108,7 +108,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
108108
{% if bgp_peer['src_address'] is defined %}
109109
neighbor {{ bgp_peer['name'] }} update-source {{ bgp_peer['src_address'] | ip }}
110110
{% else %}
111-
{% for (name, prefix) in LOOPBACK_INTERFACE %}
111+
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
112112
{% if name == 'Loopback1' %}
113113
neighbor {{ bgp_peer['name'] }} update-source {{ prefix | ip }}
114114
{% endif %}

dockers/docker-fpm-frr/frr.conf.j2

+7-7
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ log facility local4
1616
!
1717
{% block interfaces %}
1818
! Enable link-detect (default disabled)
19-
{% for (name, prefix) in INTERFACE %}
19+
{% for (name, prefix) in INTERFACE|pfx_filter %}
2020
interface {{ name }}
2121
link-detect
2222
!
@@ -30,7 +30,7 @@ link-detect
3030
!
3131
{% block default_route %}
3232
! set static default route to mgmt gateway as a backup to learned default
33-
{% for (name, prefix) in MGMT_INTERFACE %}
33+
{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %}
3434
{% if prefix | ipv4 %}
3535
ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200
3636
{% endif %}
@@ -41,7 +41,7 @@ ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200
4141
{% set lo_ipv4_addrs = [] %}
4242
{% set lo_ipv6_addrs = [] %}
4343
{% if LOOPBACK_INTERFACE %}
44-
{% for (name, prefix) in LOOPBACK_INTERFACE %}
44+
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
4545
{% if name == 'Loopback0' %}
4646
{% if prefix | ipv6 %}
4747
{% if lo_ipv6_addrs.append(prefix) %}
@@ -87,13 +87,13 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
8787
{% if DEVICE_METADATA['localhost']['type'] == 'ToRRouter' %}
8888
bgp graceful-restart
8989
{% endif %}
90-
{% for (name, prefix) in LOOPBACK_INTERFACE %}
90+
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
9191
{% if prefix | ipv4 and name == 'Loopback0' %}
9292
bgp router-id {{ prefix | ip }}
9393
{% endif %}
9494
{% endfor %}
9595
{# advertise loopback #}
96-
{% for (name, prefix) in LOOPBACK_INTERFACE %}
96+
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
9797
{% if prefix | ipv4 and name == 'Loopback0' %}
9898
network {{ prefix | ip }}/32
9999
{% elif prefix | ipv6 and name == 'Loopback0' %}
@@ -105,7 +105,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
105105
{% endblock bgp_init %}
106106
{% endif %}
107107
{% block vlan_advertisement %}
108-
{% for (name, prefix) in VLAN_INTERFACE %}
108+
{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %}
109109
{% if prefix | ipv4 %}
110110
network {{ prefix }}
111111
{% elif prefix | ipv6 %}
@@ -173,7 +173,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
173173
neighbor {{ bgp_peer['name'] }} passive
174174
neighbor {{ bgp_peer['name'] }} remote-as {{ deployment_id_asn_map[DEVICE_METADATA['localhost']['deployment_id']] }}
175175
neighbor {{ bgp_peer['name'] }} ebgp-multihop 255
176-
{% for (name, prefix) in LOOPBACK_INTERFACE %}
176+
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
177177
{% if name == 'Loopback1' %}
178178
neighbor {{ bgp_peer['name'] }} update-source {{ prefix | ip }}
179179
{% endif %}

dockers/docker-fpm-frr/zebra.conf.j2

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ enable password zebra
1414
!
1515
{% block interfaces %}
1616
! Enable link-detect (default disabled)
17-
{% for (name, prefix) in INTERFACE %}
17+
{% for (name, prefix) in INTERFACE|pfx_filter %}
1818
interface {{ name }}
1919
link-detect
2020
!
@@ -28,7 +28,7 @@ link-detect
2828
!
2929
{% block default_route %}
3030
! set static default route to mgmt gateway as a backup to learned default
31-
{% for (name, prefix) in MGMT_INTERFACE %}
31+
{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %}
3232
{% if prefix | ipv4 %}
3333
ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200
3434
{% endif %}
@@ -39,7 +39,7 @@ ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200
3939
{% set lo_ipv4_addrs = [] %}
4040
{% set lo_ipv6_addrs = [] %}
4141
{% if LOOPBACK_INTERFACE %}
42-
{% for (name, prefix) in LOOPBACK_INTERFACE %}
42+
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
4343
{% if name == 'Loopback0' %}
4444
{% if prefix | ipv6 %}
4545
{% if lo_ipv6_addrs.append(prefix) %}

dockers/docker-fpm-gobgp/zebra.conf.j2

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ enable password zebra
1414
!
1515
{% block interfaces %}
1616
! Enable link-detect (default disabled)
17-
{% for (name, prefix) in INTERFACE %}
17+
{% for (name, prefix) in INTERFACE|pfx_filter %}
1818
interface {{ name }}
1919
link-detect
2020
!
@@ -28,7 +28,7 @@ link-detect
2828
!
2929
{% block default_route %}
3030
! set static default route to mgmt gateway as a backup to learned default
31-
{% for (name, prefix) in MGMT_INTERFACE %}
31+
{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %}
3232
{% if prefix | ipv4 %}
3333
ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200
3434
{% endif %}
@@ -39,7 +39,7 @@ ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200
3939
{% set lo_ipv4_addrs = [] %}
4040
{% set lo_ipv6_addrs = [] %}
4141
{% if LOOPBACK_INTERFACE %}
42-
{% for (name, prefix) in LOOPBACK_INTERFACE %}
42+
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
4343
{% if prefix | ipv6 %}
4444
{% if lo_ipv6_addrs.append(prefix) %}
4545
{% endif %}

dockers/docker-fpm-quagga/bgpd.conf.j2

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
2929
no bgp default ipv4-unicast
3030
bgp graceful-restart restart-time 240
3131
bgp graceful-restart
32-
{% for (name, prefix) in LOOPBACK_INTERFACE %}
32+
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
3333
{% if prefix | ipv4 and name == 'Loopback0' %}
3434
bgp router-id {{ prefix | ip }}
3535
{% endif %}
3636
{% endfor %}
3737
{# advertise loopback #}
38-
{% for (name, prefix) in LOOPBACK_INTERFACE %}
38+
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
3939
{% if prefix | ipv4 and name == 'Loopback0' %}
4040
network {{ prefix | ip }}/32
4141
{% elif prefix | ipv6 and name == 'Loopback0' %}
@@ -47,7 +47,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
4747
{% endblock bgp_init %}
4848
{% endif %}
4949
{% block vlan_advertisement %}
50-
{% for (name, prefix) in VLAN_INTERFACE %}
50+
{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %}
5151
{% if prefix | ipv4 %}
5252
network {{ prefix }}
5353
{% elif prefix | ipv6 %}
@@ -108,7 +108,7 @@ router bgp {{ DEVICE_METADATA['localhost']['bgp_asn'] }}
108108
{% if bgp_peer['src_address'] is defined %}
109109
neighbor {{ bgp_peer['name'] }} update-source {{ bgp_peer['src_address'] | ip }}
110110
{% else %}
111-
{% for (name, prefix) in LOOPBACK_INTERFACE %}
111+
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
112112
{% if name == 'Loopback1' %}
113113
neighbor {{ bgp_peer['name'] }} update-source {{ prefix | ip }}
114114
{% endif %}

dockers/docker-fpm-quagga/zebra.conf.j2

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ enable password zebra
1414
!
1515
{% block interfaces %}
1616
! Enable link-detect (default disabled)
17-
{% for (name, prefix) in INTERFACE %}
17+
{% for (name, prefix) in INTERFACE|pfx_filter %}
1818
interface {{ name }}
1919
link-detect
2020
!
@@ -28,7 +28,7 @@ link-detect
2828
!
2929
{% block default_route %}
3030
! set static default route to mgmt gateway as a backup to learned default
31-
{% for (name, prefix) in MGMT_INTERFACE %}
31+
{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %}
3232
{% if prefix | ipv4 %}
3333
ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200
3434
{% endif %}
@@ -39,7 +39,7 @@ ip route 0.0.0.0/0 {{ MGMT_INTERFACE[(name, prefix)]['gwaddr'] }} 200
3939
{% set lo_ipv4_addrs = [] %}
4040
{% set lo_ipv6_addrs = [] %}
4141
{% if LOOPBACK_INTERFACE %}
42-
{% for (name, prefix) in LOOPBACK_INTERFACE %}
42+
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
4343
{% if name == 'Loopback0' %}
4444
{% if prefix | ipv6 %}
4545
{% if lo_ipv6_addrs.append(prefix) %}

dockers/docker-orchagent/ipinip.json.j2

+4-4
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
{% set ipv6_addresses = [] %}
33
{% set ipv4_loopback_addresses = [] %}
44
{% set ipv6_loopback_addresses = [] %}
5-
{% for (name, prefix) in LOOPBACK_INTERFACE %}
5+
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
66
{%- if prefix | ipv4 and name == 'Loopback0' %}
77
{%- set ipv4_addresses = ipv4_addresses.append(prefix) %}
88
{%- set ipv4_loopback_addresses = ipv4_loopback_addresses.append(prefix) %}
@@ -12,23 +12,23 @@
1212
{%- set ipv6_loopback_addresses = ipv6_loopback_addresses.append(prefix) %}
1313
{%- endif %}
1414
{% endfor %}
15-
{% for (name, prefix) in INTERFACE %}
15+
{% for (name, prefix) in INTERFACE|pfx_filter %}
1616
{%- if prefix | ipv4 %}
1717
{%- set ipv4_addresses = ipv4_addresses.append(prefix) %}
1818
{%- endif %}
1919
{%- if prefix | ipv6 %}
2020
{%- set ipv6_addresses = ipv6_addresses.append(prefix) %}
2121
{%- endif %}
2222
{% endfor %}
23-
{% for (name, prefix) in PORTCHANNEL_INTERFACE %}
23+
{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %}
2424
{%- if prefix | ipv4 %}
2525
{%- set ipv4_addresses = ipv4_addresses.append(prefix) %}
2626
{%- endif %}
2727
{%- if prefix | ipv6 %}
2828
{%- set ipv6_addresses = ipv6_addresses.append(prefix) %}
2929
{%- endif %}
3030
{% endfor %}
31-
{% for (name, prefix) in VLAN_INTERFACE %}
31+
{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %}
3232
{%- if prefix | ipv4 %}
3333
{%- set ipv4_addresses = ipv4_addresses.append(prefix) %}
3434
{%- endif %}

dockers/docker-router-advertiser/radvd.conf.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
{# If our configuration has VLAN interfaces... #}
1212
{% if VLAN_INTERFACE %}
13-
{% for (name, prefix) in VLAN_INTERFACE %}
13+
{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %}
1414
{# If this VLAN has an IPv6 address... #}
1515
{% if prefix | ipv6 %}
1616
interface {{ name }}

dockers/docker-router-advertiser/wait_for_intf.sh.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ function wait_until_iface_ready
2727

2828

2929
# Wait for all interfaces to be up and ready
30-
{% for (name, prefix) in VLAN_INTERFACE %}
30+
{% for (name, prefix) in VLAN_INTERFACE|pfx_filter %}
3131
wait_until_iface_ready ${VLAN_TABLE_PREFIX} {{ name }}
3232
{% endfor %}

files/image_config/interfaces/interfaces.j2

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
auto lo
1111
iface lo inet loopback
1212
# Use command 'ip addr list dev lo' to check all addresses
13-
{% for (name, prefix) in LOOPBACK_INTERFACE %}
13+
{% for (name, prefix) in LOOPBACK_INTERFACE|pfx_filter %}
1414
iface lo {{ 'inet' if prefix | ipv4 else 'inet6' }} static
1515
address {{ prefix | ip }}
1616
netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }}
@@ -22,7 +22,7 @@ iface lo {{ 'inet' if prefix | ipv4 else 'inet6' }} static
2222
# The management network interface
2323
auto eth0
2424
{% if MGMT_INTERFACE %}
25-
{% for (name, prefix) in MGMT_INTERFACE %}
25+
{% for (name, prefix) in MGMT_INTERFACE|pfx_filter %}
2626
iface eth0 {{ 'inet' if prefix | ipv4 else 'inet6' }} static
2727
address {{ prefix | ip }}
2828
netmask {{ prefix | netmask if prefix | ipv4 else prefix | prefixlen }}

files/image_config/ntp/ntp.conf.j2

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ server {{ ntp_server }} iburst
3030
#only listen on localhost and eth0 ips (default is to listen on all ip addresses)
3131
interface ignore wildcard
3232
{% if MGMT_INTERFACE %}
33-
{% for (mgmt_intf, mgmt_prefix) in MGMT_INTERFACE %}
33+
{% for (mgmt_intf, mgmt_prefix) in MGMT_INTERFACE|pfx_filter %}
3434
interface listen {{ mgmt_prefix | ip }}
3535
{% endfor %}
3636
{% else %}

files/scripts/arp_update

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@
99

1010
while /bin/true; do
1111
# find L3 interfaces which are UP, send ipv6 multicast pings
12-
echo "{% for (name, prefix) in INTERFACE %} {{name}} {% endfor %}" > /tmp/intf_tmp.j2
12+
echo "{% for (name, prefix) in INTERFACE|pfx_filter %} {{name}} {% endfor %}" > /tmp/intf_tmp.j2
1313
INTERFACE=`sonic-cfggen -d -t /tmp/intf_tmp.j2`
14-
echo "{% for (name, prefix) in PORTCHANNEL_INTERFACE %} {{name}} {% endfor %}" > /tmp/pc_intf_tmp.j2
14+
echo "{% for (name, prefix) in PORTCHANNEL_INTERFACE|pfx_filter %} {{name}} {% endfor %}" > /tmp/pc_intf_tmp.j2
1515
PC_INTERFACE=`sonic-cfggen -d -t /tmp/pc_intf_tmp.j2`
1616

1717
ALL_INTERFACE="$INTERFACE $PC_INTERFACE"

src/sonic-config-engine/minigraph.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -515,12 +515,16 @@ def parse_xml(filename, platform=None, port_config_file=None):
515515
for intf in intfs:
516516
if intf[0][0:4] == 'Vlan':
517517
vlan_intfs[intf] = {}
518+
vlan_intfs[intf[0]] = {}
518519
elif vlan_invert_mapping.has_key(intf[0]):
519520
vlan_intfs[(vlan_invert_mapping[intf[0]], intf[1])] = {}
521+
vlan_intfs[vlan_invert_mapping[intf[0]]] = {}
520522
elif intf[0][0:11] == 'PortChannel':
521523
pc_intfs[intf] = {}
524+
pc_intfs[intf[0]] = {}
522525
else:
523526
phyport_intfs[intf] = {}
527+
phyport_intfs[intf[0]] = {}
524528

525529
results['INTERFACE'] = phyport_intfs
526530
results['VLAN_INTERFACE'] = vlan_intfs
@@ -601,9 +605,10 @@ def parse_xml(filename, platform=None, port_config_file=None):
601605

602606
for pc_intf in pc_intfs.keys():
603607
# remove portchannels not in PORTCHANNEL dictionary
604-
if pc_intf[0] not in pcs:
608+
if isinstance(pc_intf, tuple) and pc_intf[0] not in pcs:
605609
print >> sys.stderr, "Warning: ignore '%s' interface '%s' as '%s' is not in the valid PortChannel list" % (pc_intf[0], pc_intf[1], pc_intf[0])
606610
del pc_intfs[pc_intf]
611+
pc_intfs.pop(pc_intf[0], None)
607612

608613
results['PORTCHANNEL_INTERFACE'] = pc_intfs
609614

src/sonic-config-engine/sonic-cfggen

+13
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,18 @@ def unique_name(l):
8686
new_list.append(item)
8787
return new_list
8888

89+
def pfx_filter(value):
90+
"""INTERFACE Table can have keys in one of the two formats:
91+
string or tuple - This filter skips the string keys and only
92+
take into account the tuple.
93+
For eg - VLAN_INTERFACE|Vlan1000 vs VLAN_INTERFACE|Vlan1000|192.168.0.1/21
94+
"""
95+
table = OrderedDict()
96+
for key,val in value.items():
97+
if not isinstance(key, tuple):
98+
continue
99+
table[key] = val
100+
return table
89101

90102
class FormatConverter:
91103
"""Convert config DB based schema to legacy minigraph based schema for backward capability.
@@ -234,6 +246,7 @@ def main():
234246
env.filters['ipv4'] = is_ipv4
235247
env.filters['ipv6'] = is_ipv6
236248
env.filters['unique_name'] = unique_name
249+
env.filters['pfx_filter'] = pfx_filter
237250
for attr in ['ip', 'network', 'prefixlen', 'netmask']:
238251
env.filters[attr] = partial(prefix_attr, attr)
239252
template = env.get_template(template_file)

0 commit comments

Comments
 (0)