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
e524fcf7
Commit
e524fcf7
authored
Dec 27, 2023
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_slap_tool: Disable updateComputerPartitionRelatedInstanceList
This API will be refactored on the new API
parent
20a0f457
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
24 deletions
+17
-24
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
...ateItem/portal_components/test.erp5.testSlapOSSlapTool.py
+13
-2
master/bt5/slapos_slap_tool/ToolComponentTemplateItem/portal_components/tool.erp5.SlapTool.py
...onentTemplateItem/portal_components/tool.erp5.SlapTool.py
+4
-22
No files found.
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
View file @
e524fcf7
...
...
@@ -2109,6 +2109,8 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
# Update with no changes
# updateComputerPartitionRelatedInstanceList was completely disabled so
# it has no impact to update the sucessors
instance_list_xml
=
"""
<marshal>
<list id="i2"><string>Instance0</string><string>Instance1</string></list>
...
...
@@ -2122,6 +2124,8 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
# Update Instance0 was not requested
# updateComputerPartitionRelatedInstanceList was completely disabled so
# it has no impact to update the sucessors
instance_list_xml
=
"""
<marshal>
<list id="i2"><string>Instance1</string></list>
...
...
@@ -2131,7 +2135,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
computer_partition_id
=
partition_id
,
instance_reference_xml
=
instance_list_xml
)
self
.
tic
()
self
.
assertSameSet
([
'Instance1'
],
self
.
assertSameSet
([
'Instance
0'
,
'Instance
1'
],
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
def
test_updateInstanceSuccessorList_one_child
(
self
):
...
...
@@ -2158,13 +2162,15 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
self
.
assertSameSet
([
'Instance0'
],
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
# updateComputerPartitionRelatedInstanceList was completely disabled so
# it has no impact to update the sucessors
instance_list_xml
=
'<marshal><list id="i2" /></marshal>'
self
.
portal_slap
.
updateComputerPartitionRelatedInstanceList
(
computer_id
=
self
.
compute_node_id
,
computer_partition_id
=
partition_id
,
instance_reference_xml
=
instance_list_xml
)
self
.
tic
()
self
.
assertEqual
([],
self
.
assertEqual
([
'Instance0'
],
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
def
test_updateInstanceSuccessorList_no_child
(
self
):
...
...
@@ -2178,6 +2184,9 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
self
.
start_requested_software_instance
.
getSuccessorTitleList
())
instance_list_xml
=
'<marshal><list id="i2" /></marshal>'
# updateComputerPartitionRelatedInstanceList was completely disabled so
# it has no impact to update the sucessors
self
.
portal_slap
.
updateComputerPartitionRelatedInstanceList
(
computer_id
=
self
.
compute_node_id
,
computer_partition_id
=
partition_id
,
...
...
@@ -2191,6 +2200,8 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
<marshal>
<list id="i2"><string>instance0</string></list>
</marshal>"""
# updateComputerPartitionRelatedInstanceList was completely disabled so
# it has no impact to update the sucessors
self
.
portal_slap
.
updateComputerPartitionRelatedInstanceList
(
computer_id
=
self
.
compute_node_id
,
computer_partition_id
=
partition_id
,
...
...
master/bt5/slapos_slap_tool/ToolComponentTemplateItem/portal_components/tool.erp5.SlapTool.py
View file @
e524fcf7
...
...
@@ -31,7 +31,6 @@
from
AccessControl
import
ClassSecurityInfo
from
AccessControl
import
Unauthorized
from
Products.ERP5Type.UnrestrictedMethod
import
UnrestrictedMethod
from
OFS.Traversable
import
NotFound
from
Products.DCWorkflow.DCWorkflow
import
ValidationFailed
from
Products.ERP5Type.Globals
import
InitializeClass
...
...
@@ -492,11 +491,11 @@ class SlapTool(BaseTool):
computer_partition_id
,
instance_reference_xml
):
"""
Update Software Instance successor list
DISABLED: Update Software Instance successor list
This feature was disabled completly.
"""
return
self
.
_updateComputePartitionRelatedInstanceList
(
computer_id
,
computer_partition_id
,
instance_reference_xml
)
return
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'supplySupply'
)
...
...
@@ -1012,23 +1011,6 @@ class SlapTool(BaseTool):
return
dumps
(
SlapSoftwareInstance
(
**
requested_software_instance
.
_asSoftwareInstanceDict
()))
@
UnrestrictedMethod
def
_updateComputePartitionRelatedInstanceList
(
self
,
compute_node_id
,
compute_partition_id
,
instance_reference_xml
):
"""
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
this instance.
"""
software_instance_document
=
self
.
\
_getSoftwareInstanceForComputePartition
(
compute_node_id
,
compute_partition_id
)
software_instance_document
.
_updateSucessorList
(
instance_reference_xml
)
####################################################
# Internals methods
...
...
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