]> git.puffer.fish Git - mirror/frr.git/commitdiff
tools: frr-reload support for "no no" scenario
authorDaniel Walton <dwalton@cumulusnetworks.com>
Tue, 19 Sep 2017 13:06:49 +0000 (13:06 +0000)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Tue, 19 Sep 2017 13:06:49 +0000 (13:06 +0000)
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
tools/frr-reload.py

index 8f34b4cb3f0d73e214a66534e72082353848b464..53188ec31b5bb0bd5ef4602b19cf2f212c7025a3 100755 (executable)
@@ -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')