diff options
| author | Emanuele Di Pascale <emanuele@voltanet.io> | 2019-11-12 15:36:15 +0100 |
|---|---|---|
| committer | Emanuele Di Pascale <emanuele@voltanet.io> | 2019-11-12 15:36:15 +0100 |
| commit | 609ac8dd49402e01a8a13d19e38b2eb8b33ff1f2 (patch) | |
| tree | 2630a836930af7625526c800b932224a651cf21a /tools/frr-reload.py | |
| parent | ccef6e47a3eda4adb4fd521bc2c4c036b6119d0e (diff) | |
tools, vtysh: improved fix for ldpd ifaces
instead of suppressing the 'exit' markers at the end of each
'interface XXX' clause in the mpls ldp configuration, mark
those with a special marker 'exit-ldp-if' and teach the
reload script to correctly recognize the new sub-subcontext
Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
Diffstat (limited to 'tools/frr-reload.py')
| -rwxr-xr-x | tools/frr-reload.py | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py index cf31da38b8..cc383e06d8 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -473,7 +473,7 @@ end current_context_lines = [] log.debug('LINE %-50s: popping from subcontext to ctx%-50s', line, ctx_keys) - elif line == "exit-vni": + elif line in ["exit-vni", "exit-ldp-if"]: if sub_main_ctx_key: self.save_contexts(ctx_keys, current_context_lines) @@ -525,6 +525,18 @@ end sub_main_ctx_key = copy.deepcopy(ctx_keys) log.debug('LINE %-50s: entering sub-sub-context, append to ctx_keys', line) ctx_keys.append(line) + + elif ((line.startswith("interface ") and + len(ctx_keys) == 2 and + ctx_keys[0].startswith('mpls ldp') and + ctx_keys[1].startswith('address-family'))): + + # Save old context first + self.save_contexts(ctx_keys, current_context_lines) + current_context_lines = [] + sub_main_ctx_key = copy.deepcopy(ctx_keys) + log.debug('LINE %-50s: entering sub-sub-context, append to ctx_keys', line) + ctx_keys.append(line) else: # Continuing in an existing context, add non-commented lines to it |
