diff options
| author | David Lamparter <equinox@diac24.net> | 2017-09-08 17:35:23 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-09-08 17:35:23 +0200 |
| commit | 5cf0c43de6b0950417fb1237f123c869fdef9af7 (patch) | |
| tree | 2251662b0665d8d31203b314c9aa1d1dd4df90ca /tools/frr-reload.py | |
| parent | 2e4b945a75461c460f63b57e3dcfdab0a75531f8 (diff) | |
| parent | 7918b33541265ec948a7532b37e248e89a43a935 (diff) | |
Merge pull request #1143 from dwalton76/frr-reload-vni
tools: frr-reload.py support for vni under 'address-family l2vpn evpn'
Diffstat (limited to 'tools/frr-reload.py')
| -rwxr-xr-x | tools/frr-reload.py | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py index 8556f0b46e..8f34b4cb3f 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -320,6 +320,17 @@ end exit-address-family ! end + address-family evpn + neighbor LEAF activate + advertise-all-vni + vni 10100 + rd 65000:10100 + route-target import 10.1.1.1:10100 + route-target export 10.1.1.1:10100 + exit-vni + exit-address-family +! +end router ospf ospf router-id 10.0.0.1 log-adjacency-changes detail @@ -398,7 +409,7 @@ end ctx_keys = [] current_context_lines = [] - elif line == "exit-address-family" or line == "exit": + elif line == "exit-address-family" or line == "exit" or line == "exit-vni": # if this exit is for address-family ipv4 unicast, ignore the pop if main_ctx_key: self.save_contexts(ctx_keys, current_context_lines) @@ -419,6 +430,17 @@ end new_ctx = False log.debug('LINE %-50s: entering new context, %-50s', line, ctx_keys) + elif "vni " in line: + main_ctx_key = [] + + # Save old context first + self.save_contexts(ctx_keys, current_context_lines) + current_context_lines = [] + main_ctx_key = copy.deepcopy(ctx_keys) + log.debug('LINE %-50s: entering sub-context, append to ctx_keys', line) + + ctx_keys.append(line) + elif "address-family " in line: main_ctx_key = [] @@ -874,6 +896,9 @@ def compare_context_objects(newconf, running): 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)) + elif running_ctx_keys and not any("vni" in key for key in running_ctx_keys): + lines_to_del.append((running_ctx_keys, None)) + # Global context else: for line in running_ctx.lines: |
