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
17323915
Commit
17323915
authored
Dec 11, 2024
by
Rafael Monnerat
👻
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
py3; Fixup _getXmlAsDict
parent
428e3ac5
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
5 deletions
+6
-5
master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.py
...eItem/portal_components/document.erp5.SoftwareInstance.py
+4
-4
master/bt5/slapos_cloud/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSCloud.py
...plateItem/portal_components/extension.erp5.SlapOSCloud.py
+2
-1
No files found.
master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.py
View file @
17323915
...
...
@@ -30,10 +30,10 @@ from Products.ERP5Type import Permissions
from
erp5.component.document.Item
import
Item
from
lxml
import
etree
import
collections
from
Products.ERP5Type.Utils
import
str2bytes
,
unicode2str
,
str2unicode
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
erp5.component.module.SlapOSCloud
import
_assertACI
from
Products.ERP5Type.Utils
import
unicode2str
from
zLOG
import
LOG
,
INFO
try
:
...
...
@@ -66,16 +66,16 @@ class SoftwareInstance(Item):
def
_getXmlAsDict
(
self
,
xml
):
result_dict
=
{}
if
xml
:
tree
=
etree
.
fromstring
(
xml
)
tree
=
etree
.
fromstring
(
str2bytes
(
xml
)
)
for
element
in
tree
.
iterfind
(
'parameter'
):
key
=
element
.
get
(
'id'
).
encode
(
"UTF-8"
)
key
=
str2unicode
(
element
.
get
(
'id'
)
)
value
=
result_dict
.
get
(
key
,
None
)
if
value
is
not
None
:
value
=
(
value
+
' '
+
element
.
text
)
else
:
value
=
element
.
text
if
value
is
not
None
:
value
=
value
.
encode
(
"UTF-8"
)
value
=
str2unicode
(
value
)
result_dict
[
key
]
=
value
return
result_dict
...
...
master/bt5/slapos_cloud/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSCloud.py
View file @
17323915
...
...
@@ -36,6 +36,7 @@ from Products.ERP5Type.UnrestrictedMethod import UnrestrictedMethod
from
Acquisition
import
aq_base
,
aq_inner
from
slapos.util
import
dumps
,
dict2xml
from
lxml
import
etree
from
Products.ERP5Type.Utils
import
str2bytes
def
cloneDocumentWithANewPortalType
(
obj
,
portal_type
):
import
erp5.portal_type
...
...
@@ -351,7 +352,7 @@ def isValidXml(self, value, REQUEST=None):
if
REQUEST
is
not
None
:
raise
Unauthorized
# No better way them this for now
etree
.
fromstring
(
value
)
etree
.
fromstring
(
str2bytes
(
value
)
)
return
True
def
isValidXmlMarshaller
(
self
,
value
,
REQUEST
=
None
):
...
...
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