drop batctl vd json legacy support

fixes #47
influxdb
Nils Schneider 2015-04-01 01:36:29 +02:00
parent 98d4618156
commit dd8f6b92af
2 changed files with 3 additions and 17 deletions

View File

@ -82,7 +82,7 @@ def main(params):
# acquire gwl and visdata for each batman instance
mesh_info = []
for batman in batman_instances:
vd = batman.vis_data(True)
vd = batman.vis_data()
gwl = batman.gateway_list()
mesh_info.append((vd, gwl))

View File

@ -15,11 +15,8 @@ class Batman(object):
# compile regular expressions only once on startup
self.mac_addr_pattern = re.compile(r'(([a-z0-9]{2}:){5}[a-z0-9]{2})')
def vis_data(self, batadv_vis=False):
vds = self.vis_data_batctl_legacy()
if batadv_vis:
vds += self.vis_data_batadv_vis()
return vds
def vis_data(self):
return self.vis_data_batadv_vis()
@staticmethod
def vis_data_helper(lines):
@ -32,17 +29,6 @@ class Batman(object):
pass
return vd_tmp
def vis_data_batctl_legacy(self):
"""
Parse "batctl -m <mesh_interface> vd json -n"
into an array of dictionaries.
"""
output = subprocess.check_output(
['batctl', '-m', self.mesh_interface, 'vd', 'json', '-n'])
lines = output.splitlines()
vds = self.vis_data_helper(lines)
return vds
def vis_data_batadv_vis(self):
"""
Parse "batadv-vis -i <mesh_interface> -f json"