Commit e524fcf7 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_slap_tool: Disable updateComputerPartitionRelatedInstanceList

  This API will be refactored on the new API
parent 20a0f457
......@@ -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(['Instance0', 'Instance1'],
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,
......
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment