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
Léo-Paul Géneau
slapos.core
Commits
b66e981c
Commit
b66e981c
authored
Jul 22, 2022
by
Cédric Le Ninivin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Software instance dedicated update sucessor list uses list and is accessible
parent
b223b498
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
8 deletions
+8
-8
master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.py
...eItem/portal_components/document.erp5.SoftwareInstance.py
+8
-8
No files found.
master/bt5/slapos_cloud/DocumentTemplateItem/portal_components/document.erp5.SoftwareInstance.py
View file @
b66e981c
...
...
@@ -39,12 +39,10 @@ from erp5.component.module.SlapOSCloud import _assertACI
from
zLOG
import
LOG
,
INFO
try
:
from
slapos.util
import
xml2dict
,
loads
from
slapos.util
import
xml2dict
except
ImportError
:
def
xml2dict
(
dictionary
):
raise
ImportError
def
loads
(
*
args
):
raise
ImportError
class
DisconnectedSoftwareTree
(
Exception
):
pass
...
...
@@ -281,19 +279,21 @@ class SoftwareInstance(Item, JSONType):
return
ip_address_list
def
_updateSucessorList
(
self
,
instance_reference_xml
):
def
updateRequestedInstanceList
(
self
,
instance_reference_list
):
return
self
.
_updateSucessorList
(
instance_reference_list
)
def
_updateSucessorList
(
self
,
instance_reference_list
):
"""
Update Software Instance successor list to match the given list. If one
instance was not requested by this compute partition, it should be removed
in the successor_list of this instance.
Once the link is removed, this instance will be trashed by Garbage Collect!
instance_reference_
xml
contain list of title of sub-instances requested by
instance_reference_
list
contain list of title of sub-instances requested by
this instance.
"""
cache_reference
=
'%s-PREDLIST'
%
self
.
getReference
()
if
not
self
.
isLastData
(
cache_reference
,
instance_reference_xml
):
instance_reference_list
=
loads
(
instance_reference_xml
)
if
not
self
.
isLastData
(
cache_reference
,
str
(
instance_reference_list
)):
current_successor_list
=
self
.
getSuccessorValueList
(
portal_type
=
[
'Software Instance'
,
'Slave Instance'
])
current_successor_title_list
=
[
i
.
getTitle
()
for
i
in
current_successor_list
]
...
...
@@ -307,7 +307,7 @@ class SoftwareInstance(Item, JSONType):
self
.
getReference
(),
successor_list
),
error
=
False
)
self
.
edit
(
successor_list
=
successor_list
,
comment
=
'successor_list edited to unlink non commited instances'
)
self
.
setLastData
(
instance_reference_xml
,
key
=
cache_reference
)
self
.
setLastData
(
str
(
instance_reference_list
)
,
key
=
cache_reference
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'asJSONText'
)
...
...
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