Commit 86e8d3d0 authored by Łukasz Nowak's avatar Łukasz Nowak

Optimise XML tree analysis (thanks to Nicolas Delaby)

parent 0dc0361e
......@@ -51,8 +51,7 @@ class SoftwareInstance(Item):
xml = self.getSlaXml()
if xml is not None and xml != '':
tree = etree.fromstring(xml.encode('utf-8'))
for element in tree.iter(tag=etree.Element):
if element.tag == 'parameter':
for element in tree.findall('parameter'):
key = element.get('id')
value = result_dict.get(key, None)
if value is not None:
......
241
\ No newline at end of file
242
\ No newline at end of file
......@@ -346,8 +346,7 @@ class SlapTool(BaseTool):
result_dict = {}
if xml is not None and xml != '':
tree = etree.fromstring(xml.encode('utf-8'))
for element in tree.iter(tag=etree.Element):
if element.tag == 'parameter':
for element in tree.findall('parameter'):
key = element.get('id')
value = result_dict.get(key, None)
if value is not None:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment