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
Arnaud Véron
slapos.core
Commits
12efac17
Commit
12efac17
authored
Mar 23, 2022
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Minor improvements
parent
52696697
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
15 deletions
+14
-15
master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.py
...eItem/portal_components/document.erp5.SoftwareInstance.py
+14
-15
No files found.
master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.py
View file @
12efac17
...
...
@@ -71,21 +71,18 @@ class SoftwareInstance(Item):
def
_getXmlAsDict
(
self
,
xml
):
result_dict
=
{}
if
xml
is
None
or
xml
==
''
:
return
result_dict
tree
=
etree
.
fromstring
(
xml
)
for
element
in
tree
.
findall
(
'parameter'
):
key
=
element
.
get
(
'id'
).
encode
(
"UTF-8"
)
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"
)
result_dict
[
key
]
=
value
if
xml
:
tree
=
etree
.
fromstring
(
xml
)
for
element
in
tree
.
iterfind
(
'parameter'
):
key
=
element
.
get
(
'id'
).
encode
(
"UTF-8"
)
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"
)
result_dict
[
key
]
=
value
return
result_dict
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
...
...
@@ -160,6 +157,8 @@ class SoftwareInstance(Item):
def
_asParameterDict
(
self
,
shared_instance_sql_list
=
None
):
portal
=
self
.
getPortalObject
()
compute_partition
=
self
.
getAggregateValue
(
portal_type
=
"Compute Partition"
)
if
compute_partition
is
None
:
raise
ValueError
(
"Instance isn't allocated to call _asParamterDict"
)
timestamp
=
int
(
compute_partition
.
getModificationDate
())
newtimestamp
=
int
(
self
.
getBangTimestamp
(
int
(
self
.
getModificationDate
())))
...
...
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