Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bgp: make bfdStatus be lowercase for nonestd sessions #944

Merged
merged 1 commit into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading