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