rename position.comment to position_comment
This commit is contained in:
parent
818ad5fc75
commit
e56336b106
|
@ -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]
|
||||
|
|
|
@ -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 }}
|
||||
|
|
Loading…
Reference in New Issue