-
Notifications
You must be signed in to change notification settings - Fork 678
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
Fixing 'show ip bgp neighbor <ip>' in frr unified config mode #3738
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
…ng sure to get the neighbor key from config_db either in 'x.x.x.x' format or alternatively in 'default|x.x.x.x' format as is the case with unified mode
… in unified frr config mgmt mode
0d524b8
to
8ae77f3
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@FengPan-Frank May I request a review please? |
FengPan-Frank
approved these changes
Feb 8, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @FengPan-Frank . Appreciate the review. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixing
show ip bgp neighbor neighbor_ip
command in frr unified config mode.fixes #3736
What I did
Currently this Cli fails for a valid neighbor in frr unified config mode, even when
show ip bgp neighbors
shows this neighbor correctly.The reason for this is that while trying to make sure neighbor exists in config_db, the code looks at BGP_NEIGHBOR table with key as neighbor_ip, whereas in frr unified config mode, the key is
vrfname|neighbor_ip
. I'm fixing this behavior.A nice side effect of this fix is that neighbor name now shows up in
show ip bgp summary
output, which was previously missing when frr unified config mode was enabled.How I did it
This PR fixes this issue by making sure if neighbor_ip is not present in the BGP_NEIGHBOR table, then it also checks for the entry using
*|neighbor_ip
as the key.The modified config_db.json mock table forced me to fix another issue in
show ip bgp summary
where neighbor name was not being shown in unified config mgmt mode. I couldn't segregate that fix as otherwise the unit tests won't pass.How to verify it
tests/mock_tables
has mocked config_db json files, and I modified one v4 and one v6 neighbor (for both single and multi asic case) to have the key asdefault|ip
. This makes sure that unit tests work in both the cases, when neighbor is present withneighbor_ip
as the key, as well as when it is present withvrfname|neighbor_ip
as the key.show_bgp_neighbor_test.py
testcases fail without my change (with the new modified mock_tables/config_db.json) and pass with them.Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)