From 06ad470d7cdc2b6c3cf9a8a2f150a72969d744ce Mon Sep 17 00:00:00 2001 From: Don Slice Date: Mon, 11 Feb 2019 14:17:40 -0500 Subject: [PATCH] tools: keep exit-vrf to change context correctly between vrfs Discovered in testing that if a static route in the default table was entered immediately after a vrf static block, the static route intended for the default table was put in the vrf instead. This fix retains the "exit-vrf" statement which causes the following static routes to appear in the default table correctly. Ticket: CM-23985 Signed-off-by: Don Slice --- tools/frr-reload.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/tools/frr-reload.py b/tools/frr-reload.py index c48c8b97ad..f0ff6f832f 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -435,7 +435,7 @@ end self.save_contexts(ctx_keys, current_context_lines) new_ctx = True - elif line in ["end", "exit-vrf"]: + elif line == "end": self.save_contexts(ctx_keys, current_context_lines) log.debug('LINE %-50s: exiting old context, %-50s', line, ctx_keys) @@ -445,6 +445,17 @@ end ctx_keys = [] current_context_lines = [] + elif line == "exit-vrf": + self.save_contexts(ctx_keys, current_context_lines) + current_context_lines.append(line) + log.debug('LINE %-50s: append to current_context_lines, %-50s', line, ctx_keys) + + #Start a new context + new_ctx = True + main_ctx_key = [] + ctx_keys = [] + current_context_lines = [] + elif line in ["exit-address-family", "exit", "exit-vnc"]: # if this exit is for address-family ipv4 unicast, ignore the pop if main_ctx_key: -- 2.39.5