Skip to content

Commit f175f87

Browse files
committed
Fix: Be more careful when fetching VRF RP data
The oblivious 'full speed ahead' fetching of VRF routing protocol data in 'rp_data' created empty VRF IGP instance
1 parent 20b83cb commit f175f87

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

netsim/utils/routing.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def rp_data(node: Box, proto: str, select: list = ['global','vrf']) -> typing.Ge
7676

7777
if 'vrf' in select:
7878
for vname,vdata in node.get('vrfs',{}).items():
79-
yield(vdata[proto],vdata[proto].get('interfaces',[]),vname)
79+
if proto in vdata:
80+
yield(vdata[proto],vdata[proto].get('interfaces',[]),vname)
8081

8182
'''
8283
igp_interfaces: iterate over IGP interfaces (global and VRF)

0 commit comments

Comments
 (0)