Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nxos_static_route: reconcile_candidate fails to remove 'track' routes #53806

Merged
merged 3 commits into from Mar 21, 2019

Conversation

@chrisvanheuveln
Copy link
Contributor

chrisvanheuveln commented Mar 14, 2019

SUMMARY
  • 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

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

nxos_static_route

* `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`
@ansibot

This comment has been minimized.

@chrisvanheuveln chrisvanheuveln changed the title * `reconcile_candidate()` nxos_static_route: reconcile_candidate fails to remove 'track' routes Mar 15, 2019

@ansibot ansibot removed the needs_triage label Mar 15, 2019

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

@trishnaguha trishnaguha self-assigned this Mar 18, 2019

@trishnaguha trishnaguha added this to Needs Triage in Networking via automation Mar 21, 2019

@trishnaguha trishnaguha merged commit 7b44bc1 into ansible:devel Mar 21, 2019

1 check passed

Shippable Run 114139 status is SUCCESS.
Details

Networking automation moved this from Needs Triage to Done Mar 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.