Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
41333622
Commit
41333622
authored
Nov 26, 2024
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py3: Import StringIO from six
parent
37098d88
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
master/bt5/slapos_accounting/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSAccounting.py
...Item/portal_components/extension.erp5.SlapOSAccounting.py
+3
-3
master/bt5/slapos_slap_tool/ToolComponentTemplateItem/portal_components/tool.erp5.SlapTool.py
...onentTemplateItem/portal_components/tool.erp5.SlapTool.py
+3
-3
No files found.
master/bt5/slapos_accounting/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSAccounting.py
View file @
41333622
...
...
@@ -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
)
...
...
master/bt5/slapos_slap_tool/ToolComponentTemplateItem/portal_components/tool.erp5.SlapTool.py
View file @
41333622
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment