diff options
| author | Emanuele Di Pascale <emanuele@voltanet.io> | 2020-04-27 15:47:03 +0200 |
|---|---|---|
| committer | Emanuele Di Pascale <emanuele@voltanet.io> | 2020-04-27 16:38:29 +0200 |
| commit | e04ff92ed08f976861f1cd55201ae2bad6c4623a (patch) | |
| tree | 3df638cba101a30256d994abc1375bf0f5ff3c1f /tools/frr-reload.py | |
| parent | abe94d6562ba70f8b8a6997a7b0fac381e0dcfdd (diff) | |
tools: fix frr-reload AF issue with ldpd
when removing a whole address-family block from ldpd config
we were erroneously trying to also remove each of the interface
sub-sub-contexts that belonged to it; this would effectively
re-enable the AF we just removed. Work around this by ignoring
these sub-sub-contexts if we detect that we are already
removing the parent block.
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Diffstat (limited to 'tools/frr-reload.py')
| -rwxr-xr-x | tools/frr-reload.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py index 45843faf13..1f9f425386 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -1077,6 +1077,13 @@ def compare_context_objects(newconf, running): add_cmd = ('no ' + running_ctx_keys[0],) lines_to_add.append((add_cmd, None)) + # if this an interface sub-subcontext in an address-family block in ldpd and + # we are already deleting the whole context, then ignore this + elif (len(running_ctx_keys) > 2 and running_ctx_keys[0].startswith('mpls ldp') and + running_ctx_keys[1].startswith('address-family') and + (running_ctx_keys[:2], 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)) |
