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
1
Merge Requests
1
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
Romain Courteaud
slapos.core
Commits
6dcb2958
Commit
6dcb2958
authored
Jul 22, 2022
by
Cédric Le Ninivin
Committed by
Romain Courteaud
Nov 18, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: Software instance dedicated update sucessor list uses list and is accessible
parent
38bc861e
Changes
1
Hide 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 @
6dcb2958
...
@@ -39,12 +39,10 @@ from erp5.component.module.SlapOSCloud import _assertACI
...
@@ -39,12 +39,10 @@ from erp5.component.module.SlapOSCloud import _assertACI
from
zLOG
import
LOG
,
INFO
from
zLOG
import
LOG
,
INFO
try
:
try
:
from
slapos.util
import
xml2dict
,
loads
from
slapos.util
import
xml2dict
except
ImportError
:
except
ImportError
:
def
xml2dict
(
dictionary
):
def
xml2dict
(
dictionary
):
raise
ImportError
raise
ImportError
def
loads
(
*
args
):
raise
ImportError
class
DisconnectedSoftwareTree
(
Exception
):
class
DisconnectedSoftwareTree
(
Exception
):
pass
pass
...
@@ -285,19 +283,21 @@ class SoftwareInstance(Item, JSONType):
...
@@ -285,19 +283,21 @@ class SoftwareInstance(Item, JSONType):
return
ip_address_list
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
Update Software Instance successor list to match the given list. If one
instance was not requested by this compute partition, it should be removed
instance was not requested by this compute partition, it should be removed
in the successor_list of this instance.
in the successor_list of this instance.
Once the link is removed, this instance will be trashed by Garbage Collect!
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.
this instance.
"""
"""
cache_reference
=
'%s-PREDLIST'
%
self
.
getReference
()
cache_reference
=
'%s-PREDLIST'
%
self
.
getReference
()
if
not
self
.
isLastData
(
cache_reference
,
instance_reference_xml
):
if
not
self
.
isLastData
(
cache_reference
,
str
(
instance_reference_list
)):
instance_reference_list
=
loads
(
instance_reference_xml
)
current_successor_list
=
self
.
getSuccessorValueList
(
current_successor_list
=
self
.
getSuccessorValueList
(
portal_type
=
[
'Software Instance'
,
'Slave Instance'
])
portal_type
=
[
'Software Instance'
,
'Slave Instance'
])
current_successor_title_list
=
[
i
.
getTitle
()
for
i
in
current_successor_list
]
current_successor_title_list
=
[
i
.
getTitle
()
for
i
in
current_successor_list
]
...
@@ -311,7 +311,7 @@ class SoftwareInstance(Item, JSONType):
...
@@ -311,7 +311,7 @@ class SoftwareInstance(Item, JSONType):
self
.
getReference
(),
successor_list
),
error
=
False
)
self
.
getReference
(),
successor_list
),
error
=
False
)
self
.
edit
(
successor_list
=
successor_list
,
self
.
edit
(
successor_list
=
successor_list
,
comment
=
'successor_list edited to unlink non commited instances'
)
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
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'asJSONText'
)
'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