mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 01:15:12 +00:00
tools: correct frr-reload.py handling of bgp vni/exit-vni config
Problem reported that when a peer-group was added in certain configurations, it would be rejected because of the order of the commands put in by nclu. Issued turned out to be how frr-reload.py was handling the sub-sub-context of the vni under the address-family and subsequently how it handled the following exit-vni. Ticket: CM-21996 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
This commit is contained in:
parent
7a07a176cf
commit
d60f480010
@ -413,7 +413,7 @@ end
|
|||||||
ctx_keys = []
|
ctx_keys = []
|
||||||
current_context_lines = []
|
current_context_lines = []
|
||||||
|
|
||||||
elif line in ["exit-address-family", "exit", "exit-vnc", "exit-vni"]:
|
elif line in ["exit-address-family", "exit", "exit-vnc"]:
|
||||||
# if this exit is for address-family ipv4 unicast, ignore the pop
|
# if this exit is for address-family ipv4 unicast, ignore the pop
|
||||||
if main_ctx_key:
|
if main_ctx_key:
|
||||||
self.save_contexts(ctx_keys, current_context_lines)
|
self.save_contexts(ctx_keys, current_context_lines)
|
||||||
@ -423,6 +423,15 @@ end
|
|||||||
current_context_lines = []
|
current_context_lines = []
|
||||||
log.debug('LINE %-50s: popping from subcontext to ctx%-50s', line, ctx_keys)
|
log.debug('LINE %-50s: popping from subcontext to ctx%-50s', line, ctx_keys)
|
||||||
|
|
||||||
|
elif line == "exit-vni":
|
||||||
|
if sub_main_ctx_key:
|
||||||
|
self.save_contexts(ctx_keys, current_context_lines)
|
||||||
|
|
||||||
|
# Start a new context
|
||||||
|
ctx_keys = copy.deepcopy(sub_main_ctx_key)
|
||||||
|
current_context_lines = []
|
||||||
|
log.debug('LINE %-50s: popping from sub-subcontext to ctx%-50s', line, ctx_keys)
|
||||||
|
|
||||||
elif new_ctx is True:
|
elif new_ctx is True:
|
||||||
if not main_ctx_key:
|
if not main_ctx_key:
|
||||||
ctx_keys = [line, ]
|
ctx_keys = [line, ]
|
||||||
@ -436,11 +445,7 @@ end
|
|||||||
elif (line.startswith("address-family ") or
|
elif (line.startswith("address-family ") or
|
||||||
line.startswith("vnc defaults") or
|
line.startswith("vnc defaults") or
|
||||||
line.startswith("vnc l2-group") or
|
line.startswith("vnc l2-group") or
|
||||||
line.startswith("vnc nve-group") or
|
line.startswith("vnc nve-group")):
|
||||||
(line.startswith("vni ") and
|
|
||||||
len(ctx_keys) == 2 and
|
|
||||||
ctx_keys[0].startswith('router bgp') and
|
|
||||||
ctx_keys[1] == 'address-family l2vpn evpn')):
|
|
||||||
main_ctx_key = []
|
main_ctx_key = []
|
||||||
|
|
||||||
# Save old context first
|
# Save old context first
|
||||||
@ -458,6 +463,18 @@ end
|
|||||||
else:
|
else:
|
||||||
ctx_keys.append(line)
|
ctx_keys.append(line)
|
||||||
|
|
||||||
|
elif ((line.startswith("vni ") and
|
||||||
|
len(ctx_keys) == 2 and
|
||||||
|
ctx_keys[0].startswith('router bgp') and
|
||||||
|
ctx_keys[1] == 'address-family l2vpn evpn')):
|
||||||
|
|
||||||
|
# Save old context first
|
||||||
|
self.save_contexts(ctx_keys, current_context_lines)
|
||||||
|
current_context_lines = []
|
||||||
|
sub_main_ctx_key = copy.deepcopy(ctx_keys)
|
||||||
|
log.debug('LINE %-50s: entering sub-sub-context, append to ctx_keys', line)
|
||||||
|
ctx_keys.append(line)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Continuing in an existing context, add non-commented lines to it
|
# Continuing in an existing context, add non-commented lines to it
|
||||||
current_context_lines.append(line)
|
current_context_lines.append(line)
|
||||||
|
Loading…
Reference in New Issue
Block a user