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
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Carlos Ramos Carreño
slapos.core
Commits
8a9a7912
Commit
8a9a7912
authored
Mar 01, 2024
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Plain Diff
slapos_slap_tool: decode before add to lxml.etree
See merge request
nexedi/slapos.core!606
parents
2c6ba47c
3f577d7e
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
3 deletions
+5
-3
master/bt5/slapos_slap_tool/ToolComponentTemplateItem/portal_components/tool.erp5.SlapTool.py
...onentTemplateItem/portal_components/tool.erp5.SlapTool.py
+5
-3
No files found.
master/bt5/slapos_slap_tool/ToolComponentTemplateItem/portal_components/tool.erp5.SlapTool.py
View file @
8a9a7912
...
@@ -119,14 +119,16 @@ def convertToREST(function):
...
@@ -119,14 +119,16 @@ def convertToREST(function):
def
castToStr
(
dict_kw
):
def
castToStr
(
dict_kw
):
instance
=
etree
.
Element
(
'instance'
)
instance
=
etree
.
Element
(
'instance'
)
for
_id
,
_value
in
dict_kw
.
iteritems
():
for
_id
,
_value
in
dict_kw
.
iteritems
():
# cast everything to string
# cast everything to string.
text
=
_value
if
not
isinstance
(
_value
,
str
):
text
=
str
(
_value
)
etree
.
SubElement
(
instance
,
"parameter"
,
etree
.
SubElement
(
instance
,
"parameter"
,
attrib
=
{
'id'
:
_id
}).
text
=
str
(
_value
)
attrib
=
{
'id'
:
_id
}).
text
=
text
.
decode
(
"utf-8"
)
return
etree
.
tostring
(
instance
,
pretty_print
=
True
,
return
etree
.
tostring
(
instance
,
pretty_print
=
True
,
xml_declaration
=
True
,
encoding
=
'utf-8'
)
xml_declaration
=
True
,
encoding
=
'utf-8'
)
_MARKER
=
object
()
_MARKER
=
object
()
class
SlapTool
(
BaseTool
):
class
SlapTool
(
BaseTool
):
...
...
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