Skip to content

Commit

Permalink
services/bgp: make bfdStatus be lowercase for nonestd sessions
Browse files Browse the repository at this point in the history
Signed-off-by: Dinesh Dutt <dd.ps4u@gmail.com>
  • Loading branch information
ddutt authored and AndryNick98 committed May 20, 2024
1 parent 49ee13a commit 55bef59
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions suzieq/poller/worker/services/bgp.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def _clean_eos_data(self, processed_data, raw_data):
entry['afi'] = entry['safi'] = ''
if not entry.get('bfdStatus', ''):
entry['bfdStatus'] = ''
entry['bfdStatus'] = entry['bfdStatus'].lower()
if (entry.get('holdTime', '0') == '0' and
entry.get('configHoldtime', '')):
entry['holdTime'] = entry['configHoldtime']
Expand Down Expand Up @@ -464,15 +465,16 @@ def _clean_cumulus_data(self, processed_data, _):
drop_indices = []

for i, entry in enumerate(processed_data):
if entry['state'] != 'Established':
continue

bfd_status = entry.get('bfdStatus', 'disabled').lower()
if not bfd_status or (bfd_status == "unknown"):
bfd_status = "disabled"
entry['bfdStatus'] = bfd_status

self._normalize_asn(entry)

if entry['state'] != 'Established':
continue

for afi in entry.get('_afiInfo', {}):
if afi in (entry.get('afisAdvOnly', []) or []):
continue
Expand Down Expand Up @@ -662,7 +664,7 @@ def _clean_panos_data(self, processed_data, raw_data):
if "peerIP" in entry:
peerIp = entry.get("peerIP", "").split(":")[0]
entry["peerIP"] = peerIp
entry["bfdStatus"] = bfdDict.get(peerIp, "")
entry["bfdStatus"] = bfdDict.get(peerIp, "").lower()

if "updateSource" in entry:
entry["updateSource"] = entry.get(
Expand Down

0 comments on commit 55bef59

Please sign in to comment.