Skip to content

Commit 5a87c58

Browse files
committed
bgp-ecmp-topo1: fix vrf default change
Python's `string' method 'replace' doesn't actually modify the string, instead it returns a new string with the modified content. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
1 parent 132ffd1 commit 5a87c58

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

bgp-ecmp-topo1/test_bgp_ecmp_topo1.py

+6-4
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,12 @@ def _output_summary_cmp(router, cmd, data):
139139
and compare with `data` contents.
140140
"""
141141
output = router.vtysh_cmd(cmd, isjson=True)
142-
if output.has_key('ipv4Unicast'):
143-
output['ipv4Unicast']['vrfName'].replace('default', 'Default')
144-
elif output.has_key('vrfName'):
145-
output['vrfName'].replace('default', 'Default')
142+
if 'ipv4Unicast' in output:
143+
output['ipv4Unicast']['vrfName'] = \
144+
output['ipv4Unicast']['vrfName'].replace(
145+
'default', 'Default')
146+
elif 'vrfName' in output:
147+
output['vrfName'] = output['vrfName'].replace('default', 'Default')
146148
return topotest.json_cmp(output, data)
147149

148150
test_func = functools.partial(

0 commit comments

Comments
 (0)