Commit 714a191f authored by Łukasz Nowak's avatar Łukasz Nowak

Do not die in case of instance damaged XML.

parent 60ae55a9
......@@ -412,6 +412,7 @@ class SlapTool(BaseTool):
def _instanceXmlToDict(self, xml):
result_dict = {}
try:
if xml is not None and xml != '':
tree = etree.fromstring(xml.encode('utf-8'))
for element in tree.findall('parameter'):
......@@ -422,6 +423,9 @@ class SlapTool(BaseTool):
else:
value = element.text
result_dict[key] = value
except (etree.XMLSchemaError, etree.XMLSchemaParseError,
etree.XMLSchemaValidateError, etree.XMLSyntaxError):
LOG('SlapTool', INFO, 'Issue during parsing xml:', error=True)
return result_dict
def _getSlapPartitionByPackingList(self, computer_partition_document):
......
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