Skip to content

Commit 589ebf8

Browse files
committed
update nxos mroutes service
1 parent 38b2c70 commit 589ebf8

File tree

1 file changed

+2
-30
lines changed

1 file changed

+2
-30
lines changed
Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from suzieq.poller.worker.services.service import Service
22
from suzieq.shared.utils import get_timestamp_from_cisco_time
33

4+
45
class MroutesService(Service):
56
"""Mroutes service."""
67

@@ -17,40 +18,11 @@ def _fix_star_source(self, entry):
1718
entry["source"] = "*"
1819

1920
def _common_data_cleaner(self, processed_data, _):
20-
2121
for entry in processed_data:
2222
self._fix_ipvers(entry)
2323
self._fix_star_source(entry)
2424

2525
return processed_data
26-
27-
28-
def _clean_nxos_data(self, processed_data, raw_data):
29-
reprocessed_data = {}
30-
timestamp = raw_data[0]["timestamp"]
31-
for entry in processed_data:
32-
unique = "-".join([entry["vrf"], entry["group"]])
33-
if unique in reprocessed_data:
34-
# don't have duplicate entries
35-
if entry["oifList"] not in reprocessed_data[unique]["oifList"]:
36-
reprocessed_data[unique]["oifList"].append(entry["oifList"])
37-
else:
38-
if not isinstance(entry["oifList"], list):
39-
entry["oifList"] = [entry["oifList"]]
40-
reprocessed_data.update(
41-
{
42-
unique: {
43-
"oifList": entry["oifList"],
44-
"group": entry["group"],
45-
"source": entry["source"],
46-
"vrf": entry["vrf"],
47-
"incomingIf": entry["incomingIf"],
48-
"rpfNeighbor": entry["rpfNeighbor"],
49-
"lastUpTime": get_timestamp_from_cisco_time(entry["lastUpTime"], timestamp/1000),
50-
}
51-
}
52-
)
53-
54-
processed_data = list(reprocessed_data.values())
5526

27+
def _clean_nxos_data(self, processed_data, _):
5628
return processed_data

0 commit comments

Comments
 (0)