alfred: Mark all nodes from legacy support.

This commit is contained in:
Daniel Ehlers 2014-01-30 19:10:48 +01:00
parent 2c79b1d91c
commit d9451e2ea7
2 changed files with 8 additions and 1 deletions

View file

@ -27,7 +27,10 @@ class batman:
""" """
output = subprocess.check_output(["batctl","-m",self.mesh_interface,"vd","json","-n"]) output = subprocess.check_output(["batctl","-m",self.mesh_interface,"vd","json","-n"])
lines = output.splitlines() lines = output.splitlines()
return self.vis_data_helper(lines) vds = self.vis_data_helper(lines)
for vd in vds:
vd['legacy'] = True
return vds
def vis_data_batadv_vis(self): def vis_data_batadv_vis(self):
""" Parse "batadv-vis -i <mesh_interface> -f json" into an array of dictionaries. """ Parse "batadv-vis -i <mesh_interface> -f json" into an array of dictionaries.

View file

@ -52,6 +52,8 @@ class NodeDB:
except: except:
node = Node() node = Node()
node.flags['online'] = True node.flags['online'] = True
if 'legacy' in x:
node.flags['legacy'] = True
self._nodes.append(node) self._nodes.append(node)
node.add_mac(x['of']) node.add_mac(x['of'])
@ -65,6 +67,8 @@ class NodeDB:
except: except:
node = Node() node = Node()
node.flags['online'] = True node.flags['online'] = True
if 'legacy' in x:
node.flags['legacy'] = True
node.add_mac(x['router']) node.add_mac(x['router'])
self._nodes.append(node) self._nodes.append(node)