[201911] Fix Multi-ASIC show specific recursive route by using common parsing function #1563
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What I did
This is to port the same fix from master branch to 201911 (#1560)
On Multi-ASIC DUT when the route contains recursive routes in the nexthop information the show ip route handling parsing logic was missing the parsing logic for this case due to it was using its own parsing logic instead of sharing the previous parsing function that already handle the recursive next hop case. This resulted to hitting an error during show handling similar to following:
How I did it
Changed the code to use the existing parsing function "get_nexthop_info_str()" that already handles recursive nexthop case.
This also improves code reuse.
How to verify it
After the fix in place perform similar show command and no longer see the error:
Here is the build log that shows all test passed including my new changes in
sonic-utilities-tests/ip_show_routes_multi_asic_test.py:
Note:
This change only effects DUT that are Multi-ASIC based. no impact to non-Multi-ASIC platforms.