summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xtools/frr-reload.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py
index 8f34b4cb3f..53188ec31b 100755
--- a/tools/frr-reload.py
+++ b/tools/frr-reload.py
@@ -557,7 +557,15 @@ def line_for_vtysh_file(ctx_keys, line, delete):
for ctx_key in ctx_keys:
cmd.append(ctx_key)
- return '\n' + '\n'.join(cmd)
+ cmd = '\n' + '\n'.join(cmd)
+
+ # There are some commands that are on by default so their "no" form will be
+ # displayed in the config. "no bgp default ipv4-unicast" is one of these.
+ # If we need to remove this line we do so by adding "bgp default ipv4-unicast",
+ # not by doing a "no no bgp default ipv4-unicast"
+ cmd = cmd.replace('no no ', '')
+
+ return cmd
def get_normalized_ipv6_line(line):
@@ -931,6 +939,7 @@ def compare_context_objects(newconf, running):
return (lines_to_add, lines_to_del)
+
if __name__ == '__main__':
# Command line options
parser = argparse.ArgumentParser(description='Dynamically apply diff in frr configs')