Commit 124f1a2
committed
show ip interfaces: fix exception with BGP unnumbered (PR sonic-net#3695)
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)1 parent 2c75bcd commit 124f1a2
1 file changed
Lines changed: 8 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
51 | | - | |
52 | | - | |
53 | | - | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
| |||
0 commit comments