File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed
Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change 2222import telnetlib
2323import tempfile
2424import uuid
25- from collections import defaultdict
2625
2726from netmiko import FileTransfer , InLineTransfer
2827
@@ -2076,7 +2075,7 @@ def get_bgp_neighbors(self):
20762075 return bgp_neighbor_data
20772076
20782077 def get_bgp_neighbors_detail (self , neighbor_address = "" ):
2079- bgp_detail = defaultdict ( lambda : defaultdict ( lambda : []))
2078+ bgp_detail = {}
20802079
20812080 raw_bgp_sum = self ._send_command ("show ip bgp all sum" ).strip ()
20822081
@@ -2227,6 +2226,14 @@ def get_bgp_neighbors_detail(self, neighbor_address=""):
22272226 "export_policy" : bgp_neigh_afi ["policy_out" ],
22282227 }
22292228 )
2229+
2230+ vrf_name = details ["routing_table" ]
2231+ if vrf_name not in bgp_detail .keys ():
2232+ bgp_detail [vrf_name ] = {}
2233+ remote_as = details ["remote_as" ]
2234+ if remote_as not in bgp_detail [vrf_name ].keys ():
2235+ bgp_detail [vrf_name ][remote_as ] = []
2236+
22302237 bgp_detail [details ["routing_table" ]][details ["remote_as" ]].append (details )
22312238 return bgp_detail
22322239
You can’t perform that action at this time.
0 commit comments