]> git.puffer.fish Git - mirror/frr.git/commitdiff
tools: Handle deletes of entire interface context as deleting each line
authorDinesh G Dutt <ddutt@cumulusnetworks.com>
Fri, 6 Jan 2017 22:52:25 +0000 (14:52 -0800)
committerDonald Sharp <sharpd@cumulusnetworks.com>
Mon, 30 Jan 2017 18:40:53 +0000 (13:40 -0500)
Ticket: CM-14260
Reviewed By: CCR-14260
Testing Done: quagga reload tests (quagga_service, bgp_enhe etc.)

Quagga reload handles deletes of entire context by issuing a "no.." on the
entire context itself instead of deleting each individual line of the context.
However, this doesn't work when the context is "interface" since its not
allowed to do "no interface <ifname>" inside quagga. So special case this by
deleting each individual line of the context.

Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
tools/frr-reload.py

index e15eab4a8fa0df0dfdd7f19d7f64768982535adb..57e9f026e3dd86651e4cfb8d7db2d84a9d249e29 100755 (executable)
@@ -700,6 +700,11 @@ def compare_context_objects(newconf, running):
                 delete_bgpd = True
                 lines_to_del.append((running_ctx_keys, None))
 
+            # We cannot do 'no interface' in quagga, and so deal with it
+            elif running_ctx_keys[0].startswith('interface'):
+                for line in running_ctx.lines:
+                    lines_to_del.append((running_ctx_keys, line))
+
             # If this is an address-family under 'router bgp' and we are already deleting the
             # entire 'router bgp' context then ignore this sub-context
             elif "router bgp" in running_ctx_keys[0] and len(running_ctx_keys) > 1 and delete_bgpd: