From dd8f6b92af7abb0df2e4f7cd0da031135f5ed754 Mon Sep 17 00:00:00 2001 From: Nils Schneider Date: Wed, 1 Apr 2015 01:36:29 +0200 Subject: [PATCH] drop batctl vd json legacy support fixes #47 --- backend.py | 2 +- lib/batman.py | 18 ++---------------- 2 files changed, 3 insertions(+), 17 deletions(-) diff --git a/backend.py b/backend.py index f13dff4..e5c5206 100755 --- a/backend.py +++ b/backend.py @@ -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)) diff --git a/lib/batman.py b/lib/batman.py index 4f6b943..5c48740 100644 --- a/lib/batman.py +++ b/lib/batman.py @@ -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 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 -f json"