mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-09 03:47:47 +00:00
Merge pull request #1869 from opensourcerouting/frr-reload-vnc-fix
tools/frr-reload.py: process vnc settings as sub-context
This commit is contained in:
commit
51cee26ae2
@ -413,7 +413,7 @@ end
|
|||||||
ctx_keys = []
|
ctx_keys = []
|
||||||
current_context_lines = []
|
current_context_lines = []
|
||||||
|
|
||||||
elif line == "exit-address-family" or line == "exit" or line == "exit-vni":
|
elif line in ["exit-address-family", "exit", "exit-vnc", "exit-vni"]:
|
||||||
# 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)
|
||||||
@ -433,26 +433,14 @@ end
|
|||||||
current_context_lines = []
|
current_context_lines = []
|
||||||
new_ctx = False
|
new_ctx = False
|
||||||
log.debug('LINE %-50s: entering new context, %-50s', line, ctx_keys)
|
log.debug('LINE %-50s: entering new context, %-50s', line, ctx_keys)
|
||||||
|
elif (line.startswith("address-family ") or
|
||||||
# The 'vni' keyword under 'router bgp X/address-family l2vpn evpn' creates
|
line.startswith("vnc defaults") or
|
||||||
# a sub-context but the 'vni' keyword in other places (such as 'vrf BLUE')
|
line.startswith("vnc l2-group") or
|
||||||
# does not.
|
line.startswith("vnc nve-group") or
|
||||||
elif ("vni " in line and
|
(line.startswith("vni ") and
|
||||||
len(ctx_keys) == 2 and
|
len(ctx_keys) == 2 and
|
||||||
ctx_keys[0].startswith('router bgp') and
|
ctx_keys[0].startswith('router bgp') and
|
||||||
ctx_keys[1] == 'address-family l2vpn evpn'):
|
ctx_keys[1] == 'address-family l2vpn evpn')):
|
||||||
|
|
||||||
main_ctx_key = []
|
|
||||||
|
|
||||||
# Save old context first
|
|
||||||
self.save_contexts(ctx_keys, current_context_lines)
|
|
||||||
current_context_lines = []
|
|
||||||
main_ctx_key = copy.deepcopy(ctx_keys)
|
|
||||||
log.debug('LINE %-50s: entering sub-context, append to ctx_keys', line)
|
|
||||||
|
|
||||||
ctx_keys.append(line)
|
|
||||||
|
|
||||||
elif "address-family " in line:
|
|
||||||
main_ctx_key = []
|
main_ctx_key = []
|
||||||
|
|
||||||
# Save old context first
|
# Save old context first
|
||||||
|
Loading…
Reference in New Issue
Block a user