summaryrefslogtreecommitdiff
path: root/tools/frr-reload.py
AgeCommit message (Collapse)Author
2019-10-29tools, vtysh: fix ldpd + frr-reload.pyEmanuele Di Pascale
frr-reload.py has many special case rules that did not consider ldpd at all. Specifically: 1. The bulk of ldp configuration comes in a big 'mpls ldp' context, which was previously considered a single-line context as it started with 'mpls'. This rule should only apply to labels and lsps. 2. ldp has a 'router-id' config line that fell into the same rule as the above one. It should not be considered a single-line context as more ldp configuration can follow. 3. enabled interfaces should not end their context. A better fix would actually require popping a new context for each interface in case there is any interface-specific config, but at least this fix will address the most common use case. 4. when declaring pseudowires, any line with 'member pseudowire XXX' should be considered a sub-context of the 'l2vpn YYY type ZZZ' context. Without this fix, changes in the first psuedowire declared would not correctly be processed (e.g. removing a 'control-word exclude' line would not be picked up). Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-10-29tools: frr-reload.py for single daemonEmanuele Di Pascale
allow frr-reload.py to be invoked with a --daemon option to specify an individual daemon for which the configuration diff should be computed. This is useful when integrated config is not used and we want to apply a patch to a single daemon config file. No attempt to integrate this with 'service frr reload' has been done. Making watchfrr work with per-daemon config is outside the scope of this simple patch. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-10-29tools: non hardcoded paths in frr-reloadEmanuele Di Pascale
allow command line parameters to specify different folder for the vtysh binary, config file location and temporary file. Keep the old hardcoded paths as default values for those options to preserve current functionality. Signed-off-by: Emanuele Di Pascale <emanuele@voltanet.io>
2019-07-23frr-reload.py: fix reload with different settingsRafael Zalamena
Add `allow-external-route-update` and `domainname` to the one line context list, otherwise reload will fail when those commands show up in the running configuration. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-05-17tools: fix vrrp autoconfigure reloadQuentin Young
Ticket: CM-24375 Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2019-04-25tools: frr-reload.py stop bouncing peers on bfd timer changeDon Slice
Problem reported that if a bgp neighbor had a bfd timer change made in frr.conf and systemctl reload frr performed, the neighbor with the timer changed bounced. If the change is made in vtysh by just adding the new timer values, no peer bounce occurs. This fix skips the delete part of the delete/add process in frr-reload so the peers stay up. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2019-02-27Merge pull request #3872 from dslicenc/frr-reload-vrf-contextRuss White
tools: keep exit-vrf to change context correctly between vrfs
2019-02-26tools: keep exit-vrf to change context correctly between vrfsDon Slice
Discovered in testing that if a static route in the default table was entered immediately after a vrf static block, the static route intended for the default table was put in the vrf instead. This fix retains the "exit-vrf" statement which causes the following static routes to appear in the default table correctly. Ticket: CM-23985 Signed-off-by: Don Slice <dslice@cumulusnetwork.com>
2019-02-26tools: fix blackhole static changes in frr-reload.pyDon Slice
Problem caused when nclu is used to create "ip route 1.1.1.0/24 blackhole" because frr-reload.py changed the line to Null0 instead of blackhole. If nclu tries to delete it using the same line as entered, the commit fails since it doesn't match. Ticket: CM-23986 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-12-14tools: stop frr-reload.py from trying to delete the vrf contextDon Slice
Problem seen when removing last config item under the vrf context, where frr-reload.py tries instead to delete the vrf context itself. Since that is not permitted on an active vrf, the command errors out and nothing is deleted. Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-09-26frr-reload.py: Add python2 & python3 compatibility.jpmondet
Signed-off-by: jpmondet <jp@mondet.org>
2018-08-10tools: correct frr-reload.py handling of bgp vni/exit-vni configDon Slice
Problem reported that when a peer-group was added in certain configurations, it would be rejected because of the order of the commands put in by nclu. Issued turned out to be how frr-reload.py was handling the sub-sub-context of the vni under the address-family and subsequently how it handled the following exit-vni. Ticket: CM-21996 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-07-19tools: handle exit-vrf as end of context blockDon Slice
Ticket: CM-21048 Signed-off-by: Don Slice <dslice@cumulusnetworks.com>
2018-03-12tools/frr-reload.py: process vnc settings as sub-contextChristian Franke
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
2018-01-17tools: frr-reload 'vni' keyword does not always create a sub-contextDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-11-10tools: frr-reload do not attempt deleting lines that cannot be deletedDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> There are several lines that we cannot do a "no" on - frr version - frr defaults - password - line vty frr-reload should ignore these if asked to do a "no" on them
2017-11-10tools: frr-reload remove Cumulus Linux release numbers from commentsDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> The "3.0", etc in the comments were referring to Cumulus Linux 3.0 which was confusing now that FRR has a 3.0
2017-11-10tools: frr-reload combine "'router bgp' and line" checksDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> We had multiple places checking for if ctx_keys[0].startswith('router bgp') and line Combine these into a single check
2017-11-10tools: frr-reload avoid del/add of BGP table-mapDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-11-10tools: frr-reload.py ignore multiple whitespacesDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Without this fix frr-reload would do a del/add even if the only difference were bogus whitespaces. root@cel-redxp-10[nclu]# /usr/lib/frr/frr-reload.py --test /etc/frr/frr.conf Lines To Delete =============== router bgp 100 no bgp router-id 1.1.1.1 Lines To Add ============ router bgp 100 bgp router-id 1.1.1.1 root@cel-redxp-10[nclu]#
2017-09-27tools: frr-reload.py should exit(1) if vtysh config mode is lockedDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-09-19tools: frr-reload capture stderr so we can log itDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-09-19tools: frr-reload support for "no no" scenarioDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-09-08tools: frr-reload.py support for vni under 'address-family l2vpn evpn'Daniel Walton
Signed-off-by: Vivek Venkatraman <vivek@cumulusnetworks.com>
2017-08-16vtysh: vtysh -f FOO should exit non-zero if it hits an errorDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Today if we hit an error while apply the contents of file FOO that error does not bubble up to a non-zero exit.
2017-08-08bgpd, tools, vtysh: Handle config migration from 'address-family evpn' to ↵Daniel Walton
'address-family l2vpn evpn' Ticket: CM-16747 Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Quentin Young <qlyoung@cumulusnetworks.com>
2017-07-12tools: update to use FRR nameJafar Al-Gharaibeh
Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2017-05-18Merge branch stable/2.0 into stable/3.0David Lamparter
Conflicts: bgpd/bgp_fsm.c ospf6d/ospf6_lsa.c ospfd/ospf_vty.c zebra/redistribute.c Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-05-17tools: Allow frr-reload.py to know about agentxDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-05-17tools: frr-reload.py VtyshMarkException needs to include "vtysh -m"Daniel Walton
output Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-05-17frr-reload.py fails on "no debug ospf6 message unknown"Daniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-05-17tools: frr-reload removes "ipv6 nd ra-interval" and "no ipv6 nd supp"Daniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-05-17tools: reload handle removal of entire address-family section under BGPDaniel Walton
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.
2017-05-17tools: frr-reload.py should exit non-zero when "set src x.x.x.x" failsDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-04-04tools: quagga-reload.py fails to change max-pathsDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-09Lowercase frr.confMartín Beauchamp
2017-03-07Merge branch 'frr/pull/236' ("tools: frr-reload.py needs to treat "mpls" as ↵David Lamparter
a single line context") Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2017-03-03tools: frr-reload.py needs to treat "no " as a single line contextDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-03-01tools: frr-reload.py needs to treat "mpls" as a single line contextDaniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-02-27Lowercase frr.confMartín Beauchamp
2017-02-18tools: frr-reload removes "ipv6 nd ra-interval" and "no ipv6 nd suppress-ra"Daniel Walton
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
2017-02-07*: Found some instances of Quagga.confDonald Sharp
Cleanup Quagga.conf -> Frr.conf Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2017-01-30tools: Silly typo in regex for catching ip route syntaxDinesh G Dutt
Ticket: CM-14600 Reviewed By: CCR-5615 Testing Done: Verifying the issue with/without the fix I had intended the regexp to catch both ip and ipv6 routes, but somewhere along the way, I left out the grouping in the regexp to catch if it was ip or ipv6 at the start. This caused all the rest of the matches and replaces to be off causing the issue reported by the bug. Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
2017-01-30tools: Fix unbound newaddr variable, fix too-broad except clausesDinesh G Dutt
Ticket: CM-14351 Reviewed By: dwalton Testing Done:attempts to run NCLU test failed, Daniel verified. Uninit variable bug, plus missed adding ValueError to the except clauses in a couple of places. Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
2017-01-30tools: Normalize prefix-lists and IP networks for avoiding unnecessary reloadDinesh G Dutt
Ticket: CM-14280, CM-14281, CM-14286 Reviewed By: CCR-5546 Testing Done: quagga_service_test, bgp_enhe, bgp_vrf etc. If the user specifies a network statement such as "network 1.1.1.1/24", the running config shows this as "network 1.1.1.0/24" which causes unnecessary withdrawl of the prefix and re-advertisement causing perturbations. The same thing applies to prefix-lists and of course, IPv6 addresses. IPv6 addresses were being normalized already, and so we use that same function to handle the IPv6 portion of the issue. Interestingly community strings were also getting ensnared in the normalized IPv6 function due to the presence of ':', but thats OK. quagga's running config changes 'null0' and 'blackhole' keywords into 'Null0'. For example: ip route 10.1.1.0/24 blackhole' is displayed as 'ip route 10.1.1.0/24 Null0'. Reload mistakes this and issues a delete of the Null0 route followed by an add of the "blackhole" route. Unnecessary, and results in unexpected routing perturabations. Also fix prefix-list's le/ge behavior: It always prints ge first even if the user has specified le followed by ge, and it doesn't print l3 32/128 if ge is also specified, else it prints them. Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
2017-01-30tools: Handle deletes of entire interface context as deleting each lineDinesh G Dutt
Ticket: CM-14260 Reviewed By: CCR-14260 Testing Done: quagga reload tests (quagga_service, bgp_enhe etc.) Quagga reload handles deletes of entire context by issuing a "no.." on the entire context itself instead of deleting each individual line of the context. However, this doesn't work when the context is "interface" since its not allowed to do "no interface <ifname>" inside quagga. So special case this by deleting each individual line of the context. Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
2017-01-30tools: Handle lack of "seq" in prefix-list statements.Dinesh G Dutt
Ticket: CM-14259 Reviewed By: CCR-5527 Testing Done: If users specify "ip prefix-list FOO permit 1.2.3.4/24", running config displays that line as "ip prefix-list FOO seq 5 permit 1.2.3.4/24", which causes reload to delete the running config line and add back the one in the config. This patch fixes that. Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
2017-01-30tools: Don't overwrite Quagga.conf on reload, unless user specified.Dinesh G Dutt
Ticket: CM-14059 Reviewed By: CCR-5524 Testing Done: the usual At some point in the 3.x release cycle, it was decided to overwrite the user's Quagga.conf configuration file with the output of running config when the user did a quagga reload. This is problematic for several reasons such as: losing user-specified comments, upsetting network automation scripts which think some thing has changed all the time from the specified config etc. This patch fixes this issue by not overwriting the Quagga.conf file unless the user specifies it via an additional option, or the file being used as input to quagga reload isn't the default configuration file (incl. path). Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
2017-01-30tools: Fix unnecessary routing perturbations due to old style configDinesh G Dutt
Ticket: CM-14060 Reviewed By: Testing Done: There are two harmful problems (cause routing changes in the network) with the 2.5.x style config: one with the old style specification of "multipath as-relax", and the other with ip import-table, used by redistribute neighbor In 2.5, we had the user specify 'no-as-set' as the suffix to 'bgp bestpath as-path multipath relax' to avoid quagga's default behavior which'd cause weird routing problems. However, in 3.x, we made 'no-as-set' as the default, and so its neither required to specify it nor is it shown in the running config. This means when we do quagga reload, we remove the multipath as-relax line and add it back with the no-as-set line. This causes all BGP sessions to be reset. The problem with the "ip import-table" is that it causes us to unimport the routes and then add it back again, causing routing prefix changes throughout the network, potentially causing blackholing of traffic. This fix addresses both these issues and avoids the unnecessary routing blips. Signed-off-by: Dinesh Dutt <ddutt@cumulusnetworks.com>
2017-01-04debian: Convert Quagga -> FrrDonald Sharp
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>