]> git.puffer.fish Git - matthieu/frr.git/commitdiff
tools: fix frr-reload l2vpn delete
authorEmanuele Di Pascale <emanuele@voltanet.io>
Wed, 11 Nov 2020 16:29:15 +0000 (17:29 +0100)
committerIgor Ryzhov <iryzhov@nfware.com>
Fri, 27 Nov 2020 14:41:18 +0000 (17:41 +0300)
when deleting a whole l2vpn context in ldpd which also had pseudowires
in it, we were first deleting the l2vpn with a 'no l2vpn XXX' command,
and then adding it again by running 'l2vpn XXX\n no member pseudowire YYY'
which obviously was not needed. As a result the l2vpn would be reinstated.

Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
tools/frr-reload.py

index 88873da904599cfee227582b9145ccaca1c47f04..8b4472f787aa0cc7fd88c55b5fc5eb33d31df329 100755 (executable)
@@ -1150,6 +1150,12 @@ def compare_context_objects(newconf, running):
                   (running_ctx_keys[:2], None) in lines_to_del):
                 continue
 
+            # same thing for a pseudowire sub-context inside an l2vpn context
+            elif (len(running_ctx_keys) > 1 and running_ctx_keys[0].startswith('l2vpn') and
+                  running_ctx_keys[1].startswith('member pseudowire') and
+                  (running_ctx_keys[:1], None) in lines_to_del):
+                continue
+
             # Non-global context
             elif running_ctx_keys and not any("address-family" in key for key in running_ctx_keys):
                 lines_to_del.append((running_ctx_keys, None))