Commit 00bfe674 authored by Rafael Monnerat's avatar Rafael Monnerat

py3: Import StringIO from six

parent fa91b0d6
......@@ -28,7 +28,7 @@
from lxml import etree
from zExceptions import Unauthorized
import pkg_resources
import StringIO
from six import StringIO
def ComputerConsumptionTioXMLFile_parseXml(self, REQUEST=None):
"""Call bang on self."""
......@@ -41,11 +41,11 @@ def ComputerConsumptionTioXMLFile_parseXml(self, REQUEST=None):
'slapos.slap', 'doc/computer_consumption.xsd')
# Validate against the xsd
xsd_model = StringIO.StringIO(compute_node_consumption_model)
xsd_model = StringIO(compute_node_consumption_model)
xmlschema_doc = etree.parse(xsd_model)
xmlschema = etree.XMLSchema(xmlschema_doc)
string_to_validate = StringIO.StringIO(xml)
string_to_validate = StringIO(xml)
try:
tree = etree.parse(string_to_validate)
......
......@@ -75,7 +75,7 @@ except ImportError:
from zLOG import LOG, INFO
import StringIO
from six import StringIO
import pkg_resources
from DateTime import DateTime
from App.Common import rfc1123_date
......@@ -771,11 +771,11 @@ class SlapTool(BaseTool):
def _validateXML(self, to_be_validated, xsd_model):
"""Will validate the xml file"""
#We parse the XSD model
xsd_model = StringIO.StringIO(xsd_model)
xsd_model = StringIO(xsd_model)
xmlschema_doc = etree.parse(xsd_model)
xmlschema = etree.XMLSchema(xmlschema_doc)
string_to_validate = StringIO.StringIO(to_be_validated)
string_to_validate = StringIO(to_be_validated)
try:
document = etree.parse(string_to_validate)
......
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