rename position.comment to position_comment

This commit is contained in:
Dominik Heidler 2016-01-06 19:06:43 +01:00
parent 818ad5fc75
commit e56336b106
2 changed files with 6 additions and 6 deletions

View File

@ -291,8 +291,6 @@ def parse_nodewatcher_xml(xml):
assert "coordinates" in neighbour_router["position"]
assert neighbour_router["position"]["coordinates"][0] != 0
assert neighbour_router["position"]["coordinates"][1] != 0
if "comment" in neighbour_router["position"]:
del neighbour_router["position"]["comment"]
neighbour["position"] = neighbour_router["position"]
router_update["neighbours"].append(neighbour)
@ -340,9 +338,11 @@ def netmon_fetch_router_info(mac):
# try to get comment
position_comment = r.xpath("location/text()")[0]
if position_comment != "undefined" and position_comment != " ":
router["position"]["comment"] = position_comment
router["position_comment"] = position_comment
else:
router["position_comment"] = ""
except (IndexError, AssertionError):
pass
router["position_comment"] = ""
try:
router["description"] = r.xpath("description/text()")[0]

View File

@ -113,8 +113,8 @@
{%- if router.description %}
<tr><th>Description</th><td>{{ router.description }}</td></tr>
{%- endif %}
{%- if router.position and router.position.comment %}
<tr><th>Position</th><td>{{ router.position.comment }}</td></tr>
{%- if router.position_comment %}
<tr><th>Position</th><td>{{ router.position_comment }}</td></tr>
{%- endif %}
{%- if router.hood %}
<tr><th>Hood</th><td>{{ router.hood }}