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
Jérome Perrin
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):
...
@@ -71,21 +71,18 @@ class SoftwareInstance(Item):
def
_getXmlAsDict
(
self
,
xml
):
def
_getXmlAsDict
(
self
,
xml
):
result_dict
=
{}
result_dict
=
{}
if
xml
is
None
or
xml
==
''
:
if
xml
:
return
result_dict
tree
=
etree
.
fromstring
(
xml
)
for
element
in
tree
.
iterfind
(
'parameter'
):
tree
=
etree
.
fromstring
(
xml
)
key
=
element
.
get
(
'id'
).
encode
(
"UTF-8"
)
value
=
result_dict
.
get
(
key
,
None
)
for
element
in
tree
.
findall
(
'parameter'
):
if
value
is
not
None
:
key
=
element
.
get
(
'id'
).
encode
(
"UTF-8"
)
value
=
(
value
+
' '
+
element
.
text
)
value
=
result_dict
.
get
(
key
,
None
)
else
:
if
value
is
not
None
:
value
=
element
.
text
value
=
(
value
+
' '
+
element
.
text
)
if
value
is
not
None
:
else
:
value
=
value
.
encode
(
"UTF-8"
)
value
=
element
.
text
result_dict
[
key
]
=
value
if
value
is
not
None
:
value
=
value
.
encode
(
"UTF-8"
)
result_dict
[
key
]
=
value
return
result_dict
return
result_dict
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
...
@@ -160,6 +157,8 @@ class SoftwareInstance(Item):
...
@@ -160,6 +157,8 @@ class SoftwareInstance(Item):
def
_asParameterDict
(
self
,
shared_instance_sql_list
=
None
):
def
_asParameterDict
(
self
,
shared_instance_sql_list
=
None
):
portal
=
self
.
getPortalObject
()
portal
=
self
.
getPortalObject
()
compute_partition
=
self
.
getAggregateValue
(
portal_type
=
"Compute Partition"
)
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
())
timestamp
=
int
(
compute_partition
.
getModificationDate
())
newtimestamp
=
int
(
self
.
getBangTimestamp
(
int
(
self
.
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