mirror of https://github.com/ansible/ansible.git
nxos_static_route: reconcile_candidate fails to remove 'track' routes (#53806)
* * `reconcile_candidate()` * old code searched the ip route configs for a given prefix+nexthop and then tried to remove the route based on prefix+nexthop only; this would fail when a static route was configured with `track` values. * new code still looks for prefix+nexthop but uses the route config it finds on the device to remove it; e.g. * search for: `ip route 192.168.20.64/24 192.0.2.3` * find: `ip route 192.168.20.64/24 192.0.2.3 track 1 10` * remove: `no ip route 192.168.20.64/24 192.0.2.3 track 1 10` * logic cleanups: * old code did a `show run` for every prefix. This can be a lot of data when there are large configs. * new code uses filters to only return the static route configs. * The filters now allow a common code path so no need for default vs vrf code paths * `sanity` test: 100% Pass rate on N9K,N7K,N6K,N3K - Bugfix Pull Request `nxos_static_route` * filter() does not return a list with python3 `filter()` was breaking pytest when it ran with python3, since it returns an iterable instead of a list with python3. Found that I didn't really need `filter()` anyway so just removed it * restore var names /w/want/pull/54816/head
parent
f885717f74
commit
7b44bc1ac9
Loading…
Reference in New Issue