something else
This commit is contained in:
parent
dc5ed393d6
commit
d31db3e5f5
1 changed files with 5 additions and 5 deletions
|
@ -51,6 +51,7 @@ class RootDevice(object):
|
|||
try:
|
||||
root = flatten_keys(etree_to_dict(ElementTree.fromstring(xml_string)), "{%s}" % DEVICE)[ROOT]
|
||||
except Exception as err:
|
||||
if xml_string:
|
||||
log.exception("failed to decode xml: %s\n%s", err, xml_string)
|
||||
root = {}
|
||||
self.spec_version = root.get(SPEC_VERSION)
|
||||
|
@ -81,7 +82,6 @@ class Gateway(object):
|
|||
log.info("querying %s", self.location)
|
||||
response = yield treq.get(self.location)
|
||||
response_xml = yield response.content()
|
||||
if response_xml:
|
||||
self._device = RootDevice(response_xml)
|
||||
if not self._device.devices or not self._device.services:
|
||||
log.error("failed to parse device: \n%s", response_xml)
|
||||
|
|
Loading…
Reference in a new issue