Merge pull request #17 from kratz00/empty_chipset

Added workaround for empty 'chipset' element in nodewatcher data.
This commit is contained in:
Dominik Heidler 2016-05-16 17:02:55 +02:00
commit eca3c0b5d3
1 changed files with 5 additions and 1 deletions

View File

@ -241,7 +241,6 @@ def parse_nodewatcher_xml(xml):
or len(tree.xpath("/data/interface_data/%s" % CONFIG["vpn_netif_aux"])) > 0),
},
"hardware": {
"chipset": tree.xpath("/data/system_data/chipset/text()")[0],
#"name": tree.xpath("/data/system_data/model/text()")[0],
"cpu": tree.xpath("/data/system_data/cpu/text()")[0]
},
@ -257,6 +256,11 @@ def parse_nodewatcher_xml(xml):
}
}
# data.system_data.chipset
with suppress(IndexError):
router_update["hardware"]["chipset"] = "Unknown"
router_update["hardware"]["chipset"] = tree.xpath("/data/system_data/chipset/text()")[0]
# data.system_data.model
with suppress(IndexError):
router_update["hardware"]["name"] = "Legacy"