Fixing the expected neighbor command due to change in output format under sonic-buildimage/pull/3036#584
Merged
lguohan merged 1 commit intosonic-net:masterfrom Jul 23, 2019
Conversation
…nder sonic-buildimage/pull/3036
lguohan
approved these changes
Jul 23, 2019
CharlieChenEC
pushed a commit
to CharlieChenEC/sonic-utilities
that referenced
this pull request
May 14, 2021
Commit 024e61 is based on sonic-buildimage PR sonic-net#3036, but PR sonic-net#3036 is not merged and aleardy closed, so this commit should be removed. Revert "Fixing the expected neighbor command due to change in output format under sonic-buildimage/pull/3036 (sonic-net#584)" This reverts commit 024e61f.
This file contains hidden or 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
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.
Please provide the following information:
-->
- What I did
Fixed show interface neigh expected which was broken because of sonic-net/sonic-buildimage#3036
- How I did it
There was a change in the output format for --var-json option in sonic-config-engine,changes had to be done for show commands as well.
- How to verify it
Build the sonic-utilities debian package after applying these changes or for quick test smash /usr/lib/python2.7/dist-packages/show/main.py with the file with these changes.
Test Data
admin@lnos-x1-a-csw02:
$ sonic-cfggen -d --var-json "DEVICE_NEIGHBOR"$ sonic-cfggen -d --var-json "DEVICE_NEIGHBOR_METADATA"{
"DEVICE_NEIGHBOR": {
"Ethernet112": {
"name": "lsg1-p27-csw01.nw",
"port": "Eth0"
},
"Ethernet114": {
"name": "lsg1-p27-csw02.nw",
"port": "Eth0"
}
}
}
admin@lnos-x1-a-csw02:
{
"DEVICE_NEIGHBOR_METADATA": {
"Device1": {
"lo_addr": "127.0.0.1",
"mgmt_addr": "10.0.0.1",
"type": "test1"
},
"Device2": {
"lo_addr": "127.0.0.2",
"mgmt_addr": "10.0.0.2",
"type": "test2"
}
}
}
admin@lnos-x1-a-csw02:~$
admin@lnos-x1-a-csw02:~$ show interfaces neighbor expected
LocalPort Neighbor NeighborPort NeighborLoopback NeighborMgmt NeighborType
Ethernet112 Device1 Eth0 127.0.0.1 10.0.0.1 test1
Ethernet114 Device2 Eth0 127.0.0.2 10.0.0.2 test2
admin@lnos-x1-a-csw02:~$