lib/ospf-topo1-vrf: don't compare headers of show ip route

Signed-off-by: Christian Franke <nobody@nowhere.ws>
This commit is contained in:
Christian Franke 2018-08-25 18:46:46 +02:00 committed by Donald Sharp
parent a93eb16a51
commit 41077aa191
7 changed files with 9 additions and 43 deletions

View File

@ -425,7 +425,15 @@ def ip4_route_zebra(node, vrf_name=None):
else:
tmp = node.vtysh_cmd('show ip route vrf {0}'.format(vrf_name))
output = re.sub(r" [0-2][0-9]:[0-5][0-9]:[0-5][0-9]", " XX:XX:XX", tmp)
return output
lines = output.splitlines()
header_found = False
while lines and (not strip(lines[0])
or not header_found):
if '> - selected route' in lines[0]:
header_found = True
lines = lines[1:]
return '\n'.join(lines)
def ip4_route(node):
"""

View File

@ -1,10 +1,3 @@
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR,
> - selected route, * - FIB route
VRF r1-cust1:
O 10.0.1.0/24 [110/10] is directly connected, r1-eth0, XX:XX:XX
C>* 10.0.1.0/24 is directly connected, r1-eth0, XX:XX:XX

View File

@ -1,10 +1,3 @@
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR,
> - selected route, * - FIB route
VRF r1-cust1:
O 10.0.1.0/24 [110/10] is directly connected, r1-eth0, XX:XX:XX
C>* 10.0.1.0/24 is directly connected, r1-eth0, XX:XX:XX

View File

@ -1,10 +1,3 @@
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR,
> - selected route, * - FIB route
VRF r2-cust1:
O>* 10.0.1.0/24 [110/20] via 10.0.3.2, r2-eth1, XX:XX:XX
O 10.0.2.0/24 [110/10] is directly connected, r2-eth0, XX:XX:XX

View File

@ -1,10 +1,3 @@
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR,
> - selected route, * - FIB route
VRF r2-cust1:
O>* 10.0.1.0/24 [110/20] via 10.0.3.2, r2-eth1, XX:XX:XX
O 10.0.2.0/24 [110/10] is directly connected, r2-eth0, XX:XX:XX

View File

@ -1,10 +1,3 @@
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR,
> - selected route, * - FIB route
VRF r3-cust1:
O>* 10.0.1.0/24 [110/20] via 10.0.3.2, r3-eth0, XX:XX:XX
O>* 10.0.2.0/24 [110/20] via 10.0.3.3, r3-eth0, XX:XX:XX

View File

@ -1,10 +1,3 @@
Codes: K - kernel route, C - connected, S - static, R - RIP,
O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
F - PBR,
> - selected route, * - FIB route
VRF r3-cust1:
O 10.0.10.0/24 [110/10] is directly connected, r3-eth1, XX:XX:XX
C>* 10.0.10.0/24 is directly connected, r3-eth1, XX:XX:XX