Skip to content

Commit caae8b1

Browse files
authored
Update pybgpkit to 0.6.2 (#35)
This version includes a new version of bgpkit-parser (https://github.com/bgpkit/bgpkit-parser/releases/tag/v0.11.1) which fixes an issue related to missing next-hop fields in some cases. The way to access the element fields has been changed from a dictionary style to a member style.
1 parent c6fd668 commit caae8b1

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

bgp/producers/bgpkit/bgpkit2.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,15 +23,15 @@ def delivery_report(err, msg):
2323

2424
def getElementDict(element: dict):
2525
elementDict = dict()
26-
elementDict['type'] = element['elem_type']
27-
elementDict['time'] = element['timestamp']
28-
elementDict['peer_asn'] = element['peer_asn']
29-
elementDict['peer_address'] = element['peer_ip']
26+
elementDict['type'] = element.elem_type
27+
elementDict['time'] = element.timestamp
28+
elementDict['peer_asn'] = element.peer_asn
29+
elementDict['peer_address'] = element.peer_ip
3030
elementDict['fields'] = {
31-
'next-hop': element['next_hop'],
32-
'as-path': element['as_path'],
33-
'communities': list() if not element['communities'] else element['communities'],
34-
'prefix': element['prefix']
31+
'next-hop': element.next_hop,
32+
'as-path': element.as_path,
33+
'communities': list() if not element.communities else element.communities,
34+
'prefix': element.prefix
3535
}
3636
return elementDict
3737

bgp/producers/bgpkit/requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
pybgpkit==0.5.2
1+
pybgpkit==0.6.2
22
confluent-kafka==2.10.0
33
msgpack==1.1.0

0 commit comments

Comments
 (0)