Skip to content

Commit dbbf68e

Browse files
authored
Merge pull request #944 from netenglabs/fix-poller-bgp-bfd
bgp: make bfdStatus be lowercase for nonestd sessions
2 parents 488ddcd + 55bef59 commit dbbf68e

File tree

1 file changed

+6
-4
lines changed
  • suzieq/poller/worker/services

1 file changed

+6
-4
lines changed

suzieq/poller/worker/services/bgp.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ def _clean_eos_data(self, processed_data, raw_data):
4040
entry['afi'] = entry['safi'] = ''
4141
if not entry.get('bfdStatus', ''):
4242
entry['bfdStatus'] = ''
43+
entry['bfdStatus'] = entry['bfdStatus'].lower()
4344
if (entry.get('holdTime', '0') == '0' and
4445
entry.get('configHoldtime', '')):
4546
entry['holdTime'] = entry['configHoldtime']
@@ -464,15 +465,16 @@ def _clean_cumulus_data(self, processed_data, _):
464465
drop_indices = []
465466

466467
for i, entry in enumerate(processed_data):
467-
if entry['state'] != 'Established':
468-
continue
469-
470468
bfd_status = entry.get('bfdStatus', 'disabled').lower()
471469
if not bfd_status or (bfd_status == "unknown"):
472470
bfd_status = "disabled"
473471
entry['bfdStatus'] = bfd_status
474472

475473
self._normalize_asn(entry)
474+
475+
if entry['state'] != 'Established':
476+
continue
477+
476478
for afi in entry.get('_afiInfo', {}):
477479
if afi in (entry.get('afisAdvOnly', []) or []):
478480
continue
@@ -662,7 +664,7 @@ def _clean_panos_data(self, processed_data, raw_data):
662664
if "peerIP" in entry:
663665
peerIp = entry.get("peerIP", "").split(":")[0]
664666
entry["peerIP"] = peerIp
665-
entry["bfdStatus"] = bfdDict.get(peerIp, "")
667+
entry["bfdStatus"] = bfdDict.get(peerIp, "").lower()
666668

667669
if "updateSource" in entry:
668670
entry["updateSource"] = entry.get(

0 commit comments

Comments
 (0)