api/alfred: Support Babel neighbor IP address inside tag

Signed-off-by: Adrian Schmutzler <freifunk@adrianschmutzler.de>
This commit is contained in:
Adrian Schmutzler 2018-06-18 12:05:10 +02:00
parent c01a3017a2
commit 6d492a3a25
1 changed files with 4 additions and 1 deletions

View File

@ -880,8 +880,11 @@ def parse_nodewatcher_xml(xml,statstime):
def get_l3_neighbours(tree):
l3_neighbours = list()
for neighbour in tree.xpath("/data/babel_neighbours/*"):
iptmp = evalxpath(neighbour,"ip/text()",None)
if not iptmp:
iptmp = neighbour.text
neighbour = {
"mac": get_mac_from_v6_link_local(neighbour.text).lower(),
"mac": get_mac_from_v6_link_local(iptmp).lower(),
"netif": neighbour.xpath("outgoing_interface/text()")[0],
"quality": -1.0*evalxpathfloat(neighbour,"link_cost/text()",1),
"type": "l3"