mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-08 11:18:43 +00:00
Merge pull request #10030 from anlancs/cleanup-reload-null0
tools: cleanup convertion of "Null0"
This commit is contained in:
commit
398f41c8bb
@ -433,16 +433,12 @@ class Config(object):
|
|||||||
):
|
):
|
||||||
key[0] = re.sub(r"\s+null0(\s*$)", " Null0", key[0])
|
key[0] = re.sub(r"\s+null0(\s*$)", " Null0", key[0])
|
||||||
|
|
||||||
# Similar to above, but when the static is in a vrf, it turns into a
|
|
||||||
# blackhole nexthop for both null0 and Null0. Fix it accordingly
|
|
||||||
if lines and key[0].startswith("vrf "):
|
if lines and key[0].startswith("vrf "):
|
||||||
newlines = []
|
newlines = []
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if line.startswith("ip route ") or line.startswith("ipv6 route "):
|
if line.startswith("ip route ") or line.startswith("ipv6 route "):
|
||||||
if "null0" in line:
|
if "null0" in line:
|
||||||
line = re.sub(r"\s+null0(\s*$)", " blackhole", line)
|
line = re.sub(r"\s+null0(\s*$)", " Null0", line)
|
||||||
elif "Null0" in line:
|
|
||||||
line = re.sub(r"\s+Null0(\s*$)", " blackhole", line)
|
|
||||||
newlines.append(line)
|
newlines.append(line)
|
||||||
else:
|
else:
|
||||||
newlines.append(line)
|
newlines.append(line)
|
||||||
|
Loading…
Reference in New Issue
Block a user