Skip to content

Commit d1fd5b2

Browse files
committed
Junos-mx: fix parsing vlan JSON output with trailing commas
Signed-off-by: Claudio Usai <[email protected]>
1 parent fc3bfe7 commit d1fd5b2

File tree

1 file changed

+9
-0
lines changed
  • suzieq/poller/worker/services

1 file changed

+9
-0
lines changed

suzieq/poller/worker/services/vlan.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,15 @@
66
class VlanService(Service):
77
"""Vlan service. Different class because Vlan is not right type for EOS"""
88

9+
def clean_json_input(self, data):
10+
"""evpnVni JSON output is busted across many NOS. Fix it"""
11+
12+
devtype = data.get("devtype", None)
13+
if devtype == 'junos-mx':
14+
data['data'] = data['data'].replace('}, \n }\n', '} \n }\n')
15+
16+
return data['data']
17+
918
def _clean_eos_data(self, processed_data, _):
1019
'''Massage the interface output'''
1120

0 commit comments

Comments
 (0)