11from suzieq .poller .worker .services .service import Service
22from suzieq .shared .utils import get_timestamp_from_cisco_time
33
4+
45class 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