show ip interfaces: fix exception with BGP unnumbered#3695
show ip interfaces: fix exception with BGP unnumbered#3695FengPan-Frank merged 2 commits intosonic-net:masterfrom
Conversation
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
) Without this patch an exception is thrown when running `show ip interfaces` when BGP Unnumbered is configured: ``` root@sw1:~# show ip interfaces Traceback (most recent call last): File "/usr/local/bin/ipintutil", line 280, in <module> main() File "/usr/local/bin/ipintutil", line 273, in main ip_intfs = get_ip_intfs(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace bgp_peer = get_bgp_peer() ^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer local_addr = data[neighbor_ip]['local_addr'] ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'local_addr' ``` This patch will allow the command to complete successfully. It shouldn't be necessary to actually query FRR for neighbor details, the prior version didn't, it just echo'd back config details. Signed-off-by: Brad House (@bradh352)
) Without this patch an exception is thrown when running `show ip interfaces` when BGP Unnumbered is configured: ``` root@sw1:~# show ip interfaces Traceback (most recent call last): File "/usr/local/bin/ipintutil", line 280, in <module> main() File "/usr/local/bin/ipintutil", line 273, in main ip_intfs = get_ip_intfs(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace bgp_peer = get_bgp_peer() ^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer local_addr = data[neighbor_ip]['local_addr'] ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'local_addr' ``` This patch will allow the command to complete successfully. It shouldn't be necessary to actually query FRR for neighbor details, the prior version didn't, it just echo'd back config details. Signed-off-by: Brad House (@bradh352)
) Without this patch an exception is thrown when running `show ip interfaces` when BGP Unnumbered is configured: ``` root@sw1:~# show ip interfaces Traceback (most recent call last): File "/usr/local/bin/ipintutil", line 280, in <module> main() File "/usr/local/bin/ipintutil", line 273, in main ip_intfs = get_ip_intfs(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace bgp_peer = get_bgp_peer() ^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer local_addr = data[neighbor_ip]['local_addr'] ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'local_addr' ``` This patch will allow the command to complete successfully. It shouldn't be necessary to actually query FRR for neighbor details, the prior version didn't, it just echo'd back config details. Signed-off-by: Brad House (@bradh352)
) Without this patch an exception is thrown when running `show ip interfaces` when BGP Unnumbered is configured: ``` root@sw1:~# show ip interfaces Traceback (most recent call last): File "/usr/local/bin/ipintutil", line 280, in <module> main() File "/usr/local/bin/ipintutil", line 273, in main ip_intfs = get_ip_intfs(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace bgp_peer = get_bgp_peer() ^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer local_addr = data[neighbor_ip]['local_addr'] ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'local_addr' ``` This patch will allow the command to complete successfully. It shouldn't be necessary to actually query FRR for neighbor details, the prior version didn't, it just echo'd back config details. Signed-off-by: Brad House (@bradh352)
) Without this patch an exception is thrown when running `show ip interfaces` when BGP Unnumbered is configured: ``` root@sw1:~# show ip interfaces Traceback (most recent call last): File "/usr/local/bin/ipintutil", line 280, in <module> main() File "/usr/local/bin/ipintutil", line 273, in main ip_intfs = get_ip_intfs(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace bgp_peer = get_bgp_peer() ^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer local_addr = data[neighbor_ip]['local_addr'] ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'local_addr' ``` This patch will allow the command to complete successfully. It shouldn't be necessary to actually query FRR for neighbor details, the prior version didn't, it just echo'd back config details. Signed-off-by: Brad House (@bradh352)
) Without this patch an exception is thrown when running `show ip interfaces` when BGP Unnumbered is configured: ``` root@sw1:~# show ip interfaces Traceback (most recent call last): File "/usr/local/bin/ipintutil", line 280, in <module> main() File "/usr/local/bin/ipintutil", line 273, in main ip_intfs = get_ip_intfs(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace bgp_peer = get_bgp_peer() ^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer local_addr = data[neighbor_ip]['local_addr'] ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'local_addr' ``` This patch will allow the command to complete successfully. It shouldn't be necessary to actually query FRR for neighbor details, the prior version didn't, it just echo'd back config details. Signed-off-by: Brad House (@bradh352)
FengPan-Frank
left a comment
There was a problem hiding this comment.
pls help to add exceptional test case, thanks
|
@FengPan-Frank I'm not very familiar with the way the test infrastructure is designed, I can see the existing tests for From some grepping for the IPs the existing test cases use it appears to be loaded via mock_tables/mock_single_asic.py ... I don't immediately see how to augment the config db, I see some tests do things like: But I'm pretty sure that ends up replacing the entire config_db instead of augmenting it, is that true? I guess I could do a bunch of |
we usually use mock config to do this, refer https://github.com/search?q=repo%3Asonic-net%2Fsonic-utilities%20int_ip_input&type=code |
Ok, that's the way i mentioned I wasn't sure about. Does that replace the entire CONFIG_DB, or does it merge into existing configuration? I do see it sets |
) Without this patch an exception is thrown when running `show ip interfaces` when BGP Unnumbered is configured: ``` root@sw1:~# show ip interfaces Traceback (most recent call last): File "/usr/local/bin/ipintutil", line 280, in <module> main() File "/usr/local/bin/ipintutil", line 273, in main ip_intfs = get_ip_intfs(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace bgp_peer = get_bgp_peer() ^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer local_addr = data[neighbor_ip]['local_addr'] ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'local_addr' ``` This patch will allow the command to complete successfully. It shouldn't be necessary to actually query FRR for neighbor details, the prior version didn't, it just echo'd back config details. Signed-off-by: Brad House (@bradh352)
) Without this patch an exception is thrown when running `show ip interfaces` when BGP Unnumbered is configured: ``` root@sw1:~# show ip interfaces Traceback (most recent call last): File "/usr/local/bin/ipintutil", line 280, in <module> main() File "/usr/local/bin/ipintutil", line 273, in main ip_intfs = get_ip_intfs(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace bgp_peer = get_bgp_peer() ^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer local_addr = data[neighbor_ip]['local_addr'] ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'local_addr' ``` This patch will allow the command to complete successfully. It shouldn't be necessary to actually query FRR for neighbor details, the prior version didn't, it just echo'd back config details. Signed-off-by: Brad House (@bradh352)
) Without this patch an exception is thrown when running `show ip interfaces` when BGP Unnumbered is configured: ``` root@sw1:~# show ip interfaces Traceback (most recent call last): File "/usr/local/bin/ipintutil", line 280, in <module> main() File "/usr/local/bin/ipintutil", line 273, in main ip_intfs = get_ip_intfs(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace bgp_peer = get_bgp_peer() ^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer local_addr = data[neighbor_ip]['local_addr'] ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'local_addr' ``` This patch will allow the command to complete successfully. It shouldn't be necessary to actually query FRR for neighbor details, the prior version didn't, it just echo'd back config details. Signed-off-by: Brad House (@bradh352)
) Without this patch an exception is thrown when running `show ip interfaces` when BGP Unnumbered is configured: ``` root@sw1:~# show ip interfaces Traceback (most recent call last): File "/usr/local/bin/ipintutil", line 280, in <module> main() File "/usr/local/bin/ipintutil", line 273, in main ip_intfs = get_ip_intfs(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace bgp_peer = get_bgp_peer() ^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer local_addr = data[neighbor_ip]['local_addr'] ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'local_addr' ``` This patch will allow the command to complete successfully. It shouldn't be necessary to actually query FRR for neighbor details, the prior version didn't, it just echo'd back config details. Signed-off-by: Brad House (@bradh352)
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
I've tried quite a few things here and I can't see a way for the ipintutil to ever read anything other than the single or multi asic mock tables. The only thing I've gotten to work is I saw there was a Vlan100 defined in that mock table with a link-local ipv6 address, so I assigned that interface to use BGP Unnumbered and should cover the exception. Hopefully this is good enough. |
|
@FengPan-Frank my solution appears to have brought coverage up to 100% of the changes, hopefully this is acceptable so it can be merged. |
) Without this patch an exception is thrown when running `show ip interfaces` when BGP Unnumbered is configured: ``` root@sw1:~# show ip interfaces Traceback (most recent call last): File "/usr/local/bin/ipintutil", line 280, in <module> main() File "/usr/local/bin/ipintutil", line 273, in main ip_intfs = get_ip_intfs(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace bgp_peer = get_bgp_peer() ^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer local_addr = data[neighbor_ip]['local_addr'] ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'local_addr' ``` This patch will allow the command to complete successfully. It shouldn't be necessary to actually query FRR for neighbor details, the prior version didn't, it just echo'd back config details. Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
) Without this patch an exception is thrown when running `show ip interfaces` when BGP Unnumbered is configured: ``` root@sw1:~# show ip interfaces Traceback (most recent call last): File "/usr/local/bin/ipintutil", line 280, in <module> main() File "/usr/local/bin/ipintutil", line 273, in main ip_intfs = get_ip_intfs(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace bgp_peer = get_bgp_peer() ^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer local_addr = data[neighbor_ip]['local_addr'] ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'local_addr' ``` This patch will allow the command to complete successfully. It shouldn't be necessary to actually query FRR for neighbor details, the prior version didn't, it just echo'd back config details. Signed-off-by: Brad House (@bradh352)
) Without this patch an exception is thrown when running `show ip interfaces` when BGP Unnumbered is configured: ``` root@sw1:~# show ip interfaces Traceback (most recent call last): File "/usr/local/bin/ipintutil", line 280, in <module> main() File "/usr/local/bin/ipintutil", line 273, in main ip_intfs = get_ip_intfs(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace bgp_peer = get_bgp_peer() ^^^^^^^^^^^^^^ File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer local_addr = data[neighbor_ip]['local_addr'] ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^ KeyError: 'local_addr' ``` This patch will allow the command to complete successfully. It shouldn't be necessary to actually query FRR for neighbor details, the prior version didn't, it just echo'd back config details. Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
* show ip interfaces: fix exception with BGP unnumbered
Without this patch an exception is thrown when running `show ip interfaces`
when BGP Unnumbered is configured:
```
root@sw1:~# show ip interfaces
Traceback (most recent call last):
File "/usr/local/bin/ipintutil", line 280, in <module>
main()
File "/usr/local/bin/ipintutil", line 273, in main
ip_intfs = get_ip_intfs(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 236, in get_ip_intfs
ip_intfs_in_ns = get_ip_intfs_in_namespace(af, namespace, display)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 149, in get_ip_intfs_in_namespace
bgp_peer = get_bgp_peer()
^^^^^^^^^^^^^^
File "/usr/local/bin/ipintutil", line 51, in get_bgp_peer
local_addr = data[neighbor_ip]['local_addr']
~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^
KeyError: 'local_addr'
```
This patch will allow the command to complete successfully. It shouldn't
be necessary to actually query FRR for neighbor details, the prior version
didn't, it just echo'd back config details.
Signed-off-by: Brad House (@bradh352)
* add coverage for exception handled by this PR
---------
Signed-off-by: Brad House (@bradh352)
What I did
Without this patch an exception is thrown when running
show ip interfaceswhen BGP Unnumbered is configured:This patch will allow the command to complete successfully. It shouldn't be necessary to actually query FRR for neighbor details, the prior version didn't, it just echo'd back config details.
This is a slightly different patch to what #3565 does. It does not add blank values to the output parameter, it skips due to exception handling.
How I did it
Added try / except logic block around optional key/values.
How to verify it
Configure BGP Unnumbered via FRR Management framework and observe 'show ip interfaces' fails with above error. Apply patch and observe expected output.
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)
Fixes #3565
Fixes sonic-net/sonic-buildimage#19930
Signed-off-by: Brad House (@bradh352)