-
Notifications
You must be signed in to change notification settings - Fork 48
Fix get_route_to
or fix tests
#238
Comments
I have commented under #233 (comment) -- I don't see (1) as a sane solution. I tend to consider (2) more suitable. |
(answering to your comment here instead of on the other thread)
Nobody wants to remove anything, just move it around.
Easy to answer that and I will just refer to the code: https://github.com/napalm-automation/napalm-eos/blob/develop/napalm_eos/eos.py#L1054 Protocol is a switch to go to a branch of the code that contains ~100 lines of code. Adding a new protocol implies branching again and executing 100 other different lines of code. In any case, please, read point 1 again. Nobody mentioned removing anything, jut moving
And then each driver just has to implement |
Thanks for expanding on this @dbarrosop - indeed, I misread the comments above, apologies. Makes sense to me, however it may take longer to get this done :) |
Agreed, but hopefully things will be easier in the future so we may save time in the long run. |
I had an issue if the route installed was through ibgp then it used to error out as - line 1071, in get_route_to |
The
get_route_to
method is a tricky one as theprotocol
argument is not thoroughly tested and might lead to differences in terms of support across different drivers. For example, a driver could supportstatic
andbgp
while another might support onlystatic
.Proposed solutions:
get_route_to
only lives innapalm-base
and calls forget_route_to_static
,get_route_to_bgp
, etc... that are individual implementations in the drivers. Would be nice to have an IPv4/IPv6 flag, btw.get_route_to
and control tests/behaviour with mocked data as described here: Test case for static routes (v4+v6) #233 (comment)Pinging some people that might be interested on this discussion: @napalm-automation/council @manuel-domke @bewing
The text was updated successfully, but these errors were encountered: