Skip to content

Commit

Permalink
fixed mongodb overflow for extended_community bigger than 8 bytes; sa…
Browse files Browse the repository at this point in the history
…ve extended_community as string now
  • Loading branch information
Sebastian Forstner committed Nov 14, 2024
1 parent 2b4e36c commit 23ee9f5
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/adapters/mongodb.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ def on_update(message: RouteUpdate):
else:
aggregator = None

extended_community: Optional[list[str]] = None
if message.path_attributes.extended_community:
for ext_com in message.path_attributes.extended_community:
if extended_community == None:
extended_community = [str(ext_com)]
else:
extended_community.append(str(ext_com))

'''creates dict for message with _id and other unique attributes, that dont change'''
new_message_id = {
'timestamp' : message.timestamp,
Expand All @@ -89,7 +97,7 @@ def on_update(message: RouteUpdate):
'aggregator' : aggregator,
'community' : message.path_attributes.community,
'large_community' : message.path_attributes.large_community,
'extended_community' : message.path_attributes.extended_community,
'extended_community' : extended_community,
'orginator_id' : message.path_attributes.orginator_id,
'cluster_list' : message.path_attributes.cluster_list,
},
Expand All @@ -112,7 +120,7 @@ def on_update(message: RouteUpdate):
'aggregator' : aggregator,
'community' : message.path_attributes.community,
'large_community' : message.path_attributes.large_community,
'extended_community' : message.path_attributes.extended_community,
'extended_community' : extended_community,
'orginator_id' : message.path_attributes.orginator_id,
'cluster_list' : message.path_attributes.cluster_list,
},
Expand Down

0 comments on commit 23ee9f5

Please sign in to comment.