This commit is contained in:
Nils Schneider 2014-05-31 14:53:28 +02:00
parent 26fc2a9aef
commit f18d0b38a9
5 changed files with 7 additions and 3 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
*.pyc
aliases.json
nodedb/

View file

@ -38,5 +38,5 @@ class alfred:
if __name__ == "__main__":
ad = alfred()
al = ad.alias()
al = ad.aliases()
print(al)

View file

@ -49,7 +49,7 @@ if options['mesh']:
bm = batman(mesh_interface)
db.parse_vis_data(bm.vis_data(options['alfred']))
for gw in bm.gateway_list():
db.mark_gateways(gw.mac)
db.mark_gateways(gw['mac'])
else:
bm = batman()
db.parse_vis_data(bm.vis_data(options['alfred']))

View file

@ -59,6 +59,8 @@ class batman:
gw.append({'mac': own_mac, 'bandwidth': gw_mode['bandwidth']})
for line in lines:
gw_line = line.split()
if (gw_line[0] == 'No'):
continue
# When in client gateway mode maybe gw_line[0] is not the right.
gw.append({'mac':gw_line[0], 'bandwidth': gw_line[-1]})
return gw

View file

@ -182,7 +182,7 @@ class NodeDB:
if 'name' in alias:
node.name = alias['name']
if 'vpn' in alias and alias['vpn']:
if 'vpn' in alias and alias['vpn'] and mac and node.interfaces and mac in node.interfaces:
node.interfaces[mac].vpn = True
if 'gps' in alias:
@ -202,6 +202,7 @@ class NodeDB:
try:
node = self.maybe_node_by_mac((gateway, ))
except:
print("WARNING: did not find gateway '",gateway,"' in node list")
continue
node.flags['gateway'] = True