diff options
author | Daniel Walton <dwalton@cumulusnetworks.com> | 2017-05-17 02:16:09 +0200 |
---|---|---|
committer | Daniel Walton <dwalton@cumulusnetworks.com> | 2017-05-17 02:16:09 +0200 |
commit | afa2e8e1870eab4578e19c80cfd23bb443d1adbe (patch) | |
tree | 82ef54ddd73d208d94ab10c5aabffd21995457c4 | |
parent | tools: frr-reload.py should exit non-zero when "set src x.x.x.x" fails (diff) | |
download | frr-afa2e8e1870eab4578e19c80cfd23bb443d1adbe.tar.xz frr-afa2e8e1870eab4578e19c80cfd23bb443d1adbe.zip |
tools: reload handle removal of entire address-family section under BGP
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
When an entire address-family section is removed from under BGP, we
cannot just issue 'no address-family foo bar' as address-family line
doesn't support 'no'. We have to delete the individual lines under the
address-family.
-rwxr-xr-x | tools/frr-reload.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/frr-reload.py b/tools/frr-reload.py index 0e71eaa04..1ef6920d0 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -814,6 +814,14 @@ def compare_context_objects(newconf, running): elif "router bgp" in running_ctx_keys[0] and len(running_ctx_keys) > 1 and delete_bgpd: continue + elif ("router bgp" in running_ctx_keys[0] and + len(running_ctx_keys) > 1 and + running_ctx_keys[1].startswith('address-family')): + # There's no 'no address-family' support and so we have to + # delete each line individually again + for line in running_ctx.lines: + lines_to_del.append((running_ctx_keys, line)) + # 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)) |