diff --git a/master/bt5/slapos_category/PathTemplateItem/portal_categories/allocation_scope/open/friend.xml b/master/bt5/slapos_category/PathTemplateItem/portal_categories/allocation_scope/open/friend.xml deleted file mode 100644 index 1b69b429a753667d8a9bbec3ec7948840fd92f80..0000000000000000000000000000000000000000 --- a/master/bt5/slapos_category/PathTemplateItem/portal_categories/allocation_scope/open/friend.xml +++ /dev/null @@ -1,81 +0,0 @@ -<?xml version="1.0"?> -<ZopeData> - <record id="1" aka="AAAAAAAAAAE="> - <pickle> - <global name="Category" module="erp5.portal_type"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>_Add_portal_content_Permission</string> </key> - <value> - <tuple> - <string>Assignor</string> - <string>Manager</string> - </tuple> - </value> - </item> - <item> - <key> <string>_Add_portal_folders_Permission</string> </key> - <value> - <tuple> - <string>Assignor</string> - <string>Manager</string> - </tuple> - </value> - </item> - <item> - <key> <string>_Copy_or_Move_Permission</string> </key> - <value> - <tuple> - <string>Assignor</string> - <string>Manager</string> - </tuple> - </value> - </item> - <item> - <key> <string>_Delete_objects_Permission</string> </key> - <value> - <tuple> - <string>Assignor</string> - <string>Manager</string> - </tuple> - </value> - </item> - <item> - <key> <string>_Modify_portal_content_Permission</string> </key> - <value> - <tuple> - <string>Assignee</string> - <string>Assignor</string> - <string>Manager</string> - <string>Owner</string> - </tuple> - </value> - </item> - <item> - <key> <string>description</string> </key> - <value> <string>Allocate services for the owner of the friends of the compute_node</string> </value> - </item> - <item> - <key> <string>effective_date</string> </key> - <value> - <none/> - </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>friend</string> </value> - </item> - <item> - <key> <string>portal_type</string> </key> - <value> <string>Category</string> </value> - </item> - <item> - <key> <string>title</string> </key> - <value> <string>Friend</string> </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Alarm_managePublicComputeNodeCapacityScope.py b/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Alarm_managePublicComputeNodeCapacityScope.py index ef46e7ba2f313c84618bdb16d3917c819f415271..30ec75e5d55f907d3af459bf6f272b6fef18a33b 100644 --- a/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Alarm_managePublicComputeNodeCapacityScope.py +++ b/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Alarm_managePublicComputeNodeCapacityScope.py @@ -2,7 +2,6 @@ portal = context.getPortalObject() category_list = [portal.restrictedTraverse("portal_categories/allocation_scope/open/public", None), portal.restrictedTraverse("portal_categories/allocation_scope/open/subscription", None), - portal.restrictedTraverse("portal_categories/allocation_scope/open/friend", None), portal.restrictedTraverse("portal_categories/allocation_scope/open/personal", None)] category_uid_list = [ i.getUid() for i in category_list if i is not None] diff --git a/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_checkAndUpdateCapacityScope.py b/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_checkAndUpdateCapacityScope.py index fe7f1441426a967c46bf4bf35212ba0a259a9e74..51ffcecc043cdb7d737137b6bd8213848318a85a 100644 --- a/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_checkAndUpdateCapacityScope.py +++ b/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_checkAndUpdateCapacityScope.py @@ -4,7 +4,7 @@ from zExceptions import Unauthorized if REQUEST is not None: raise Unauthorized -if compute_node.getAllocationScope() not in ['open/public', 'open/subscription', 'open/personal', 'open/friend']: +if compute_node.getAllocationScope() not in ['open/public', 'open/subscription', 'open/personal']: # Don't update non closed computers return diff --git a/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_viewCapacity.xml b/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_viewCapacity.xml index f6e30486ffd82af485e0881ec0ec10ef9c6c7adc..37f8d347848291ddc691f79a8b221c9e60a95625 100644 --- a/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_viewCapacity.xml +++ b/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_viewCapacity.xml @@ -108,7 +108,6 @@ <value> <list> <string>my_allocation_scope</string> - <string>my_subject_list</string> <string>my_translated_validation_state_title</string> </list> </value> diff --git a/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_viewCapacity/my_subject_list.xml b/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_viewCapacity/my_subject_list.xml deleted file mode 100644 index c80426130d301e56b5ba84037b521c951d35543a..0000000000000000000000000000000000000000 --- a/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/ComputeNode_viewCapacity/my_subject_list.xml +++ /dev/null @@ -1,313 +0,0 @@ -<?xml version="1.0"?> -<ZopeData> - <record id="1" aka="AAAAAAAAAAE="> - <pickle> - <global name="LinesField" module="Products.Formulator.StandardFields"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>id</string> </key> - <value> <string>my_subject_list</string> </value> - </item> - <item> - <key> <string>message_values</string> </key> - <value> - <dictionary> - <item> - <key> <string>external_validator_failed</string> </key> - <value> <string>The input failed the external validator.</string> </value> - </item> - <item> - <key> <string>line_too_long</string> </key> - <value> <string>A line was too long.</string> </value> - </item> - <item> - <key> <string>required_not_found</string> </key> - <value> <string>Input is required but no input given.</string> </value> - </item> - <item> - <key> <string>too_long</string> </key> - <value> <string>You entered too many characters.</string> </value> - </item> - <item> - <key> <string>too_many_lines</string> </key> - <value> <string>You entered too many lines.</string> </value> - </item> - </dictionary> - </value> - </item> - <item> - <key> <string>overrides</string> </key> - <value> - <dictionary> - <item> - <key> <string>alternate_name</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>css_class</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>default</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>description</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>editable</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>enabled</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>external_validator</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>extra</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>height</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>hidden</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>max_length</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>max_linelength</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>max_lines</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>required</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>title</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>unicode</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>view_separator</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>whitespace_preserve</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>width</string> </key> - <value> <string></string> </value> - </item> - </dictionary> - </value> - </item> - <item> - <key> <string>tales</string> </key> - <value> - <dictionary> - <item> - <key> <string>alternate_name</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>css_class</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>default</string> </key> - <value> - <persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent> - </value> - </item> - <item> - <key> <string>description</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>editable</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>enabled</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>external_validator</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>extra</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>height</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>hidden</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>max_length</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>max_linelength</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>max_lines</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>required</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>title</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>unicode</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>view_separator</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>whitespace_preserve</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>width</string> </key> - <value> <string></string> </value> - </item> - </dictionary> - </value> - </item> - <item> - <key> <string>values</string> </key> - <value> - <dictionary> - <item> - <key> <string>alternate_name</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>css_class</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>default</string> </key> - <value> - <list/> - </value> - </item> - <item> - <key> <string>description</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>editable</string> </key> - <value> <int>1</int> </value> - </item> - <item> - <key> <string>enabled</string> </key> - <value> <int>1</int> </value> - </item> - <item> - <key> <string>external_validator</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>extra</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>height</string> </key> - <value> <int>5</int> </value> - </item> - <item> - <key> <string>hidden</string> </key> - <value> <int>0</int> </value> - </item> - <item> - <key> <string>max_length</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>max_linelength</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>max_lines</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>required</string> </key> - <value> <int>0</int> </value> - </item> - <item> - <key> <string>title</string> </key> - <value> <string>Friends (email)</string> </value> - </item> - <item> - <key> <string>unicode</string> </key> - <value> <int>0</int> </value> - </item> - <item> - <key> <string>view_separator</string> </key> - <value> <string encoding="cdata"><![CDATA[ - -<br /> - -]]></string> </value> - </item> - <item> - <key> <string>whitespace_preserve</string> </key> - <value> <int>0</int> </value> - </item> - <item> - <key> <string>width</string> </key> - <value> <int>40</int> </value> - </item> - </dictionary> - </value> - </item> - </dictionary> - </pickle> - </record> - <record id="2" aka="AAAAAAAAAAI="> - <pickle> - <global name="TALESMethod" module="Products.Formulator.TALESField"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>_text</string> </key> - <value> <string>python: here.getSubjectList()</string> </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareRelease_getUsableComputeNodeList.py b/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareRelease_getUsableComputeNodeList.py index db16ca2e0a62fd4df7e5e5b6c9a4093c488a914d..fc0b09d3443792851e1ce18f61271a8a51c9dc00 100644 --- a/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareRelease_getUsableComputeNodeList.py +++ b/master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareRelease_getUsableComputeNodeList.py @@ -4,7 +4,7 @@ kw['url_string'] = context.getUrlString() software_installation_list = context.portal_catalog(**kw) compute_node_list = [] -allocation_scope_list = ['open/personal', 'open/public', 'open/friend'] +allocation_scope_list = ['open/personal', 'open/public'] for software_installation in software_installation_list: compute_node = software_installation.getAggregateValue() if software_installation.getSlapState() == 'start_requested' and \ diff --git a/master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py b/master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py index 36c116487128bffaf217997672ba963830e1aa63..8417403c99bbb4beb77e4db46270a8675a80f1bd 100644 --- a/master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py +++ b/master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py @@ -177,19 +177,6 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin): self.assertEqual('open', server.getCapacityScope()) self.tic() - @changeSkin('RJS') - def setServerOpenFriend(self, server, friend_list=None): - if friend_list is None: - friend_list = [] - server.edit( - allocation_scope='open/friend', subject_list=friend_list) - self.assertEqual('open/friend', server.getAllocationScope()) - # Called by alarm - server.ComputeNode_checkAndUpdateCapacityScope() - self.assertEqual('open', server.getCapacityScope()) - self.assertSameSet(friend_list, server.getSubjectList()) - self.tic() - def formatComputeNode(self, compute_node, partition_count=10): compute_node_dict = dict( software_root='/opt', diff --git a/master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAlarm.py b/master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAlarm.py index 7b5ce59f40d2fa79d00286c5cef216d1c0418235..f3f8c74dddb28dcf6e08c327daf8281212fea17f 100644 --- a/master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAlarm.py +++ b/master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAlarm.py @@ -480,9 +480,6 @@ class TestSlapOSComputeNode_checkAndUpdateCapacityScopeSubscription(TestSlapOSCo class TestSlapOSComputeNode_checkAndUpdateCapacityScopePersonal(TestSlapOSComputeNode_checkAndUpdateCapacityScope): allocation_scope_to_test = 'open/personal' -class TestSlapOSComputeNode_checkAndUpdateCapacityScopeFriend(TestSlapOSComputeNode_checkAndUpdateCapacityScope): - allocation_scope_to_test = 'open/friend' - class TestSlapOSUpdateComputeNodeCapacityScopeAlarm(SlapOSTestCaseMixin): def afterSetUp(self): @@ -513,10 +510,6 @@ class TestSlapOSUpdateComputeNodeCapacityScopeAlarm(SlapOSTestCaseMixin): self.compute_node.edit(allocation_scope='open/personal') self.test_alarm() - def test_alarm_friend(self): - self.compute_node.edit(allocation_scope='open/friend') - self.test_alarm() - def test_alarm_non_public(self): self.compute_node.edit(allocation_scope='close') self._test_alarm_not_visited( diff --git a/master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAllocationAlarm.py b/master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAllocationAlarm.py index f83e41f9f307cb12b3d1736653ac594d37dcdc31..1be89ac26255849d998058253367d6a0ff00060d 100644 --- a/master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAllocationAlarm.py +++ b/master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAllocationAlarm.py @@ -242,80 +242,6 @@ return True""" ) self.assertEqual(self.partition.getRelativeUrl(), self.software_instance.getAggregate(portal_type='Compute Partition')) - @simulate('Person_isAllowedToAllocate', '*args, **kwargs', 'return True') - def test_allocation_allocation_scope_open_friend(self): - self._makeTree() - - self._makeComputeNode() - self._installSoftware(self.compute_node, - self.software_instance.getUrlString()) - # change compute_node owner - new_id = self.generateNewId() - person_user = self.portal.person_module.template_member.\ - Base_createCloneDocument(batch_mode=1) - person_user.edit( - title="live_test_%s" % new_id, - reference="live_test_%s" % new_id, - default_email_text="live_test_%s@example.org" % new_id, - ) - - person_user.validate() - for assignment in person_user.contentValues(portal_type="Assignment"): - assignment.open() - - self.compute_node.edit( - source_administration=person_user.getRelativeUrl(), - destination_section=self.person_user.getRelativeUrl(), - allocation_scope='open/friend') - self.compute_node.setAccessStatus("#access ok") - self.tic() - self.compute_node.ComputeNode_checkAndUpdateCapacityScope() - self.assertEqual(self.compute_node.getCapacityScope(), 'open') - self.tic() - - self.assertEqual(None, self.software_instance.getAggregateValue( - portal_type='Compute Partition')) - self.software_instance.SoftwareInstance_tryToAllocatePartition() - self.assertEqual(self.partition.getRelativeUrl(), - self.software_instance.getAggregate(portal_type='Compute Partition')) - - @simulate('Person_isAllowedToAllocate', '*args, **kwargs', 'return True') - def test_allocation_host_allocation_scope_open_friend(self): - self._makeSlaveTree() - - self._makeComputeNode() - self._allocateHost(self.requested_software_instance, - self.partition) - # change compute_node owner - new_id = self.generateNewId() - person_user = self.portal.person_module.template_member.\ - Base_createCloneDocument(batch_mode=1) - person_user.edit( - title="live_test_%s" % new_id, - reference="live_test_%s" % new_id, - default_email_text="live_test_%s@example.org" % new_id, - ) - - person_user.validate() - for assignment in person_user.contentValues(portal_type="Assignment"): - assignment.open() - - self.compute_node.edit( - source_administration=person_user.getRelativeUrl(), - destination_section=self.person_user.getRelativeUrl(), - allocation_scope='open/friend') - self.compute_node.setAccessStatus("#access ok") - self.tic() - self.compute_node.ComputeNode_checkAndUpdateCapacityScope() - self.assertEqual(self.compute_node.getCapacityScope(), 'open') - self.tic() - - self.assertEqual(None, self.software_instance.getAggregateValue( - portal_type='Compute Partition')) - self.software_instance.SoftwareInstance_tryToAllocatePartition() - self.assertEqual(self.partition.getRelativeUrl(), - self.software_instance.getAggregate(portal_type='Compute Partition')) - @simulate('Person_isAllowedToAllocate', '*args, **kwargs', 'return True') def test_allocation_does_not_fail_on_instance_with_damaged_sla_xml(self): self._makeTree() diff --git a/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/ComputeNodeModule_getComputeNodeTicketReportList.py b/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/ComputeNodeModule_getComputeNodeTicketReportList.py index a07de093c9401ffc6277ff313cadc48b588f364d..542b8e665e350e215f61fd5b75e11b538d4970c8 100644 --- a/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/ComputeNodeModule_getComputeNodeTicketReportList.py +++ b/master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/ComputeNodeModule_getComputeNodeTicketReportList.py @@ -5,9 +5,6 @@ from Products.ERP5Type.Document import newTempBase public_category_uid = portal.restrictedTraverse( "portal_categories/allocation_scope/open/public", None).getUid() -friend_category_uid = portal.restrictedTraverse( - "portal_categories/allocation_scope/open/friend", None).getUid() - personal_category_uid = portal.restrictedTraverse( "portal_categories/allocation_scope/open/personal", None).getUid() @@ -24,7 +21,7 @@ def checkForError(reference): return 1 for compute_node in portal.portal_catalog( - default_allocation_scope_uid = [personal_category_uid, public_category_uid, friend_category_uid], + default_allocation_scope_uid = [personal_category_uid, public_category_uid], select_list={"reference": None}, **kw): diff --git a/master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py b/master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py index 68f547f0b7ae85e2e464f9b13e4328024556bc8d..e0ce5e1726fdec49cce0068b04d12a54c8a1b193 100644 --- a/master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py +++ b/master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMAlarm.py @@ -486,14 +486,6 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort) slapos_crm_check_compute_node_state self._test_alarm(alarm, self.compute_node, "ComputeNode_checkState") - def test_alarm_check_friend_compute_node_state(self): - self._makeComputeNode() - self.compute_node.edit(allocation_scope='open/friend') - self.tic() - alarm = self.portal.portal_alarms.\ - slapos_crm_check_compute_node_state - self._test_alarm(alarm, self.compute_node, "ComputeNode_checkState") - def test_alarm_check_personal_compute_node_state(self): self._makeComputeNode() self.compute_node.edit(allocation_scope='open/personal') @@ -533,11 +525,6 @@ class TestSlapOSCrmMonitoringCheckComputeNodeState(SlapOSTestCaseMixinWithAbort) allocation_scope='open/public', monitor_scope="disabled") - def test_alarm_check_compute_node_state_on_friend_compute_node_with_monitor_scope_disabled(self): - self._test_alarm_check_compute_node_state_not_selected( - allocation_scope='open/friend', - monitor_scope="disabled") - def test_alarm_check_compute_node_state_on_personal_compute_node_with_monitor_scope_disabled(self): self._test_alarm_check_compute_node_state_not_selected( allocation_scope='open/personal', @@ -569,15 +556,6 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase slapos_crm_check_software_installation_state self._test_alarm(alarm, self.compute_node, "ComputeNode_checkSoftwareInstallationState") - def test_alarm_run_on_open_friend(self): - self._makeComputeNode() - self.compute_node.edit(allocation_scope = 'open/friend') - self.tic() - alarm = self.portal.portal_alarms.\ - slapos_crm_check_software_installation_state - self._test_alarm(alarm, self.compute_node, "ComputeNode_checkSoftwareInstallationState") - - def test_alarm_run_on_open_personal(self): self._makeComputeNode() self.compute_node.edit(allocation_scope = 'open/personal', @@ -597,16 +575,6 @@ class TestSlapOSCrmMonitoringCheckComputeNodeSoftwareInstallation(SlapOSTestCase slapos_crm_check_software_installation_state self._test_alarm_not_visited(alarm, self.compute_node, "ComputeNode_checkSoftwareInstallationState") - def test_alarm_dont_run_on_open_friend_with_monitor_scope_disabled(self): - self._makeComputeNode() - self.compute_node.edit(allocation_scope = 'open/friend') - self.tic() - self.compute_node.edit(monitor_scope = 'disabled') - self.tic() - alarm = self.portal.portal_alarms.\ - slapos_crm_check_software_installation_state - self._test_alarm_not_visited(alarm, self.compute_node, "ComputeNode_checkSoftwareInstallationState") - def test_alarm_dont_run_on_open_personal_with_monitor_scope_disabled(self): self._makeComputeNode() self.compute_node.edit(allocation_scope = 'open/personal', diff --git a/master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ComputeNode_getSecurityCategoryFromAllocationScope.py b/master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ComputeNode_getSecurityCategoryFromAllocationScope.py index 85432d6ceec2c2b833f161a7d0f2747abfaf967a..4316f5a8b8f8c0354f7c981cd1982418f9b23e16 100644 --- a/master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ComputeNode_getSecurityCategoryFromAllocationScope.py +++ b/master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_core/ComputeNode_getSecurityCategoryFromAllocationScope.py @@ -24,9 +24,5 @@ elif scope == 'open/personal': person = compute_node.getSourceAdministrationValue(portal_type="Person") if person is not None: return {"Auditor": ["SHADOW-%s" % person.getUserId()]} -elif scope == 'open/friend': - person_list = compute_node.getDestinationSectionValueList(portal_type="Person") - if person_list: - return {"Auditor": ["SHADOW-%s" % x.getUserId() for x in person_list]} return category_list diff --git a/master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5DefaultScenario.py b/master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5DefaultScenario.py index fbf2cff077d62cadfd44bf325d49f40fa3e07c1c..dc601d6e71e64ff3c9e71449cf9cd333b5b72e13 100644 --- a/master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5DefaultScenario.py +++ b/master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5DefaultScenario.py @@ -57,14 +57,6 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin): self.assertNotEqual(None, personal_server) self.setServerOpenPersonal(personal_server) - friend_server_title = 'Friend Server for %s' % owner_reference - friend_server_id = self.requestComputeNode(friend_server_title) - friend_server = self.portal.portal_catalog.getResultValue( - portal_type='Compute Node', reference=friend_server_id) - self.setAccessToMemcached(friend_server) - self.assertNotEqual(None, friend_server) - self.setServerOpenFriend(friend_server) - # and install some software on them public_server_software = self.generateNewSoftwareReleaseUrl() self.supplySoftware(public_server, public_server_software) @@ -72,14 +64,9 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin): personal_server_software = self.generateNewSoftwareReleaseUrl() self.supplySoftware(personal_server, personal_server_software) - friend_server_software = self.generateNewSoftwareReleaseUrl() - self.supplySoftware(friend_server, friend_server_software) - # format the compute_nodes self.formatComputeNode(public_server) self.formatComputeNode(personal_server) - self.formatComputeNode(friend_server) - # join as the another visitor and request software instance on public # compute_node @@ -99,68 +86,55 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin): public_server_software, public_instance_type, public_server) - # join as owner friend and request a software instance on compute_node + # join as other person and request a software instance on compute_node # configured by owner self.logout() - friend_reference = 'friend-%s' % self.generateNewId() - self.joinSlapOS(self.web_site, friend_reference) + other_reference = 'other-%s' % self.generateNewId() + self.joinSlapOS(self.web_site, other_reference) self.login() - friend_person = self.portal.portal_catalog.getResultValue( - portal_type='ERP5 Login', reference=friend_reference).getParentValue() - friend_email = friend_person.getDefaultEmailText() + other_person = self.portal.portal_catalog.getResultValue( + portal_type='ERP5 Login', reference=other_reference).getParentValue() - # allow friend to alloce on friendly compute_node + # allow other to alloce on public compute_node self.login(owner_person.getUserId()) - self.setServerOpenFriend(friend_server, [friend_email]) - friend_instance_title = 'Friend title %s' % self.generateNewId() - friend_instance_type = 'friend_type' - self.checkInstanceAllocation(friend_person.getUserId(), friend_reference, - friend_instance_title, friend_server_software, friend_instance_type, - friend_server) + other_instance_title = 'Other title %s' % self.generateNewId() + other_instance_type = 'other_type' + self.checkInstanceAllocation(other_person.getUserId(), other_reference, + other_instance_title, public_server_software, other_instance_type, + public_server) - # check that friend is able to request slave instance matching the + # check that other person is able to request slave instance matching the # public's compute_node software instance - friend_slave_instance_title = 'Friend slave title %s' % self.\ + other_slave_instance_title = 'Other slave title %s' % self.\ generateNewId() - self.checkSlaveInstanceAllocation(friend_person.getUserId(), - friend_reference, friend_slave_instance_title, public_server_software, + self.checkSlaveInstanceAllocation(other_person.getUserId(), + other_reference, other_slave_instance_title, public_server_software, public_instance_type, public_server) - # turn public guy to a friend and check that he can allocate slave - # instance on instance provided by friend + # turn public guy to a other person and check that he can allocate slave + # instance on instance provided by other person self.login() public_person = self.portal.portal_catalog.getResultValue( portal_type='ERP5 Login', reference=public_reference).getParentValue() - public_email = public_person.getDefaultEmailText() - self.login(owner_person.getUserId()) - self.setServerOpenFriend(friend_server, [friend_email, public_email]) - - public_slave_instance_title = 'Public slave title %s' % self\ - .generateNewId() - self.checkSlaveInstanceAllocation(public_person.getUserId(), - public_reference, public_slave_instance_title, friend_server_software, - friend_instance_type, friend_server) # now deallocate the slaves - self.checkSlaveInstanceUnallocation(public_person.getUserId(), - public_reference, public_slave_instance_title, friend_server_software, - friend_instance_type, friend_server) - - self.checkSlaveInstanceUnallocation(friend_person.getUserId(), - friend_reference, friend_slave_instance_title, public_server_software, - public_instance_type, public_server) + self.login(owner_person.getUserId()) + self.checkSlaveInstanceUnallocation(other_person.getUserId(), + other_reference, other_slave_instance_title, public_server_software, + other_instance_type, public_server) # and the instances self.checkInstanceUnallocation(public_person.getUserId(), public_reference, public_instance_title, public_server_software, public_instance_type, public_server) - self.checkInstanceUnallocation(friend_person.getUserId(), - friend_reference, friend_instance_title, - friend_server_software, friend_instance_type, friend_server) + self.checkInstanceUnallocation(other_person.getUserId(), + other_reference, other_instance_title, + public_server_software, other_instance_type, public_server +) # and uninstall some software on them self.logout() @@ -169,15 +143,12 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin): state='destroyed') self.supplySoftware(personal_server, personal_server_software, state='destroyed') - self.supplySoftware(friend_server, friend_server_software, - state='destroyed') self.logout() # Uninstall from compute_node self.login() self.simulateSlapgridSR(public_server) self.simulateSlapgridSR(personal_server) - self.simulateSlapgridSR(friend_server) # check the Open Sale Order coverage self.stepCallSlaposRequestUpdateInstanceTreeOpenSaleOrderAlarm() @@ -186,7 +157,7 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin): self.login() self.assertOpenSaleOrderCoverage(owner_reference) - self.assertOpenSaleOrderCoverage(friend_reference) + self.assertOpenSaleOrderCoverage(other_reference) self.assertOpenSaleOrderCoverage(public_reference) # generate simulation for open order @@ -257,7 +228,7 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin): self.tic() # check final document state - for person_reference in (owner_reference, friend_reference, + for person_reference in (owner_reference, other_reference, public_reference): person = self.portal.portal_catalog.getResultValue( portal_type='ERP5 Login', reference=person_reference).getParentValue() @@ -266,8 +237,8 @@ class TestSlapOSDefaultScenario(DefaultScenarioMixin): self.login(public_person.getUserId()) self.usePaymentManually(self.web_site, public_person.getUserId()) - self.login(friend_person.getUserId()) - self.usePaymentManually(self.web_site, friend_person.getUserId()) + self.login(other_person.getUserId()) + self.usePaymentManually(self.web_site, other_person.getUserId()) class TestSlapOSDefaultCRMEscalation(DefaultScenarioMixin): @@ -570,4 +541,4 @@ class TestSlapOSDefaultCRMEscalation(DefaultScenarioMixin): self.tic() # check final document state - self.assertPersonDocumentCoverage(person) + self.assertPersonDocumentCoverage(person) \ No newline at end of file diff --git a/master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py b/master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py index 9361a960e184784c8a9de068efdaf9c6c44fe46b..e55cc0126b090d9565c76122758d73b2a9e05912 100644 --- a/master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py +++ b/master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5GroupRoleSecurity.py @@ -206,23 +206,6 @@ class TestComputeNode(TestSlapOSGroupRoleSecurityMixin): self.assertRoles(compute_node, self.user_id, ['Owner']) self.assertRoles(compute_node, compute_node.getUserId(), ['Assignor']) - # open/friend - friend_reference = 'TESTPERSON-%s' % self.generateNewId() - friend_person = self.portal.person_module.newContent(portal_type='Person', - reference=friend_reference) - compute_node.edit(allocation_scope='open/friend', - destination_section=friend_person.getRelativeUrl() - ) - compute_node.updateLocalRolesOnSecurityGroups() - shadow_friend_user_id = 'SHADOW-%s' % friend_person.getUserId() - self.assertSecurityGroup(compute_node, - [self.user_id, 'G-COMPANY', shadow_friend_user_id, - person.getUserId(), compute_node.getUserId()], False) - self.assertRoles(compute_node, shadow_friend_user_id, ['Auditor']) - self.assertRoles(compute_node, self.user_id, ['Owner']) - self.assertRoles(compute_node, compute_node.getUserId(), ['Assignor']) - - def test_selfComputeNode(self): reference = 'TESTCOMP-%s' % self.generateNewId() compute_node = self.portal.compute_node_module.newContent(portal_type='Compute Node', diff --git a/master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5InteractionWorkflow.py b/master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5InteractionWorkflow.py index a0a6d32fb7e9e08602ca308da59c4d809b4ca346..efc240cf6a8ec8d17bfba87730e10efc13a8ea55 100644 --- a/master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5InteractionWorkflow.py +++ b/master/bt5/slapos_erp5/TestTemplateItem/portal_components/test.erp5.testSlapOSERP5InteractionWorkflow.py @@ -60,101 +60,15 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope( allocation_scope="open/subscription" ) - def test_ComputeNode_setAllocationScope_public_with_source_adm(self): - person = self.makePerson() - self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""]) - - compute_node = self._test_ComputeNode_setAllocationScope_public( - source_administration=person.getRelativeUrl()) - - self.assertEqual(compute_node.getSubjectList(), ['']) - self.assertEqual(compute_node.getDestinationSection(), None) - - def test_ComputeNode_setAllocationScope_subscription_with_source_adm(self): - person = self.makePerson() - self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""]) - - compute_node = self._test_ComputeNode_setAllocationScope_public( - source_administration=person.getRelativeUrl(), - allocation_scope="open/subscription") - - self.assertEqual(compute_node.getSubjectList(), ['']) - self.assertEqual(compute_node.getDestinationSection(), None) - - - def _test_ComputeNode_setAllocationScope_personal(self, - source_administration=None, - subject_list=None): + def test_ComputeNode_setAllocationScope_personal(self, + source_administration=None): compute_node = self.portal.compute_node_module.newContent(portal_type='Compute Node', capacity_scope=None, monitor_scope=None, source_administration=source_administration) - if subject_list: - compute_node.setSubjectList(subject_list) - self.commit() - compute_node.edit(allocation_scope='open/personal') self.commit() - self.assertEqual(compute_node.getCapacityScope(), 'close') - self.assertEqual(compute_node.getMonitorScope(), 'enabled') - self.commit() - compute_node.edit(allocation_scope=None) - self.commit() - - compute_node.edit(capacity_scope="open") - self.commit() - compute_node.edit(allocation_scope='open/personal') - self.commit() - - self.assertEqual(compute_node.getCapacityScope(), 'close') - self.assertEqual(compute_node.getMonitorScope(), 'enabled') - return compute_node - - def test_ComputeNode_setAllocationScope_personal(self): - compute_node = self._test_ComputeNode_setAllocationScope_personal() - self.assertEqual(compute_node.getSubjectList(), []) - self.assertEqual(compute_node.getDestinationSection(), None) - - def test_ComputeNode_setAllocationScope_personal_with_source_adm(self): - person = self.makePerson() - self.tic() - - self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""]) - compute_node = self._test_ComputeNode_setAllocationScope_personal( - source_administration=person.getRelativeUrl(), - ) - self.assertEqual(compute_node.getSubjectList(), [person.getDefaultEmailCoordinateText()]) - self.assertEqual(compute_node.getDestinationSectionList(), - [person.getRelativeUrl()]) - - def test_ComputeNode_setAllocationScope_personal_with_subject_list(self): - person = self.makePerson() - self.tic() - - self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""]) - compute_node = self._test_ComputeNode_setAllocationScope_personal( - source_administration=person.getRelativeUrl(), - subject_list=["some@example.com"] - ) - self.assertEqual(compute_node.getSubjectList(), [person.getDefaultEmailCoordinateText()]) - self.assertEqual(compute_node.getDestinationSectionList(), - [person.getRelativeUrl()]) - - def _test_ComputeNode_setAllocationScope_friend(self, - source_administration=None, - subject_list=None): - compute_node = self.portal.compute_node_module.newContent(portal_type='Compute Node') - - compute_node.edit(capacity_scope=None, - monitor_scope=None, - source_administration=source_administration) - - if subject_list: - compute_node.setSubjectList(subject_list) - - self.commit() - compute_node.edit(allocation_scope='open/friend') self.commit() self.assertEqual(compute_node.getCapacityScope(), 'close') @@ -166,53 +80,22 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope( compute_node.edit(capacity_scope="open") self.commit() - compute_node.edit(allocation_scope='open/friend') + compute_node.edit(allocation_scope='open/personal') self.commit() self.assertEqual(compute_node.getCapacityScope(), 'close') self.assertEqual(compute_node.getMonitorScope(), 'enabled') return compute_node - def test_ComputeNode_setAllocationScope_friend_with_source_adm(self): - person = self.makePerson() - self.tic() - self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""]) - - compute_node = self._test_ComputeNode_setAllocationScope_friend( - source_administration=person.getRelativeUrl()) - - self.assertEqual(compute_node.getSubjectList(), [person.getDefaultEmailCoordinateText()]) - self.assertEqual(compute_node.getDestinationSectionList(), - [person.getRelativeUrl()]) - - def test_ComputeNode_setAllocationScope_friend_with_subject_list(self): - person = self.makePerson() - self.tic() - self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""]) - - compute_node = self._test_ComputeNode_setAllocationScope_friend( - source_administration=person.getRelativeUrl(), - subject_list=["some@example.com"] - ) - - self.assertSameSet(compute_node.getSubjectList(), - ['some@example.com', person.getDefaultEmailCoordinateText()]) - - self.assertEqual(compute_node.getDestinationSectionList(), - [person.getRelativeUrl()]) - - def _test_ComputeNode_setAllocationScope_closed(self, source_administration=None, allocation_scope="close/forever", - subject_list=None, monitor_scope='enabled'): compute_node = self.portal.compute_node_module.newContent(portal_type='Compute Node', capacity_scope=None, monitor_scope=None, source_administration=source_administration) - if subject_list: - compute_node.setSubjectList(subject_list) + self.commit() compute_node.edit(allocation_scope=allocation_scope) @@ -235,89 +118,25 @@ class TestSlapOSERP5InteractionWorkflowComputeNodeSetAllocationScope( return compute_node - def test_ComputeNode_setAllocationScope_closed_forever_no_source_adm(self): + def test_ComputeNode_setAllocationScope_closed_forever(self): self._test_ComputeNode_setAllocationScope_closed(monitor_scope='disabled') - def test_ComputeNode_setAllocationScope_closed_forever_with_source_adm(self): - person = self.makePerson() - self.tic() - self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""]) - - compute_node = self._test_ComputeNode_setAllocationScope_closed( - source_administration=person.getRelativeUrl(), monitor_scope='disabled') - - self.assertEqual(compute_node.getSubjectList(), [person.getDefaultEmailCoordinateText()]) - self.assertEqual(compute_node.getDestinationSectionList(), - [person.getRelativeUrl()]) - - def test_ComputeNode_setAllocationScope_closed_termination_no_source_adm(self): + def test_ComputeNode_setAllocationScope_closed_termination(self): self._test_ComputeNode_setAllocationScope_closed( allocation_scope="close/termination", ) - def test_ComputeNode_setAllocationScope_closed_termination_with_source_adm(self): - person = self.makePerson() - self.tic() - self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""]) - - compute_node = self._test_ComputeNode_setAllocationScope_closed( - allocation_scope="close/termination", - source_administration=person.getRelativeUrl()) - - self.assertEqual(compute_node.getSubjectList(), [person.getDefaultEmailCoordinateText()]) - self.assertEqual(compute_node.getDestinationSectionList(), - [person.getRelativeUrl()]) - - def test_ComputeNode_setAllocationScope_closed_outdated_no_source_adm(self): + def test_ComputeNode_setAllocationScope_closed_outdated(self): self._test_ComputeNode_setAllocationScope_closed( allocation_scope="close/outdated", ) - def test_ComputeNode_setAllocationScope_closed_outdated_with_source_adm(self): - person = self.makePerson() - self.tic() - self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""]) - - compute_node = self._test_ComputeNode_setAllocationScope_closed( - allocation_scope="close/outdated", - source_administration=person.getRelativeUrl()) - - self.assertEqual(compute_node.getSubjectList(), [person.getDefaultEmailCoordinateText()]) - self.assertEqual(compute_node.getDestinationSectionList(), - [person.getRelativeUrl()]) - - def test_ComputeNode_setAllocationScope_closed_maintenance_no_source_adm(self): + def test_ComputeNode_setAllocationScope_closed_maintenance(self): self._test_ComputeNode_setAllocationScope_closed( allocation_scope="close/maintenance", ) - def test_ComputeNode_setAllocationScope_closed_maintenance_with_source_adm(self): - person = self.makePerson() - self.tic() - self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""]) - - compute_node = self._test_ComputeNode_setAllocationScope_closed( - allocation_scope="close/maintenance", - source_administration=person.getRelativeUrl()) - - self.assertEqual(compute_node.getSubjectList(), [person.getDefaultEmailCoordinateText()]) - self.assertEqual(compute_node.getDestinationSectionList(), - [person.getRelativeUrl()]) - - def test_ComputeNode_setAllocationScope_closed_noallocation_no_source_adm(self): + def test_ComputeNode_setAllocationScope_closed_noallocation(self): self._test_ComputeNode_setAllocationScope_closed( allocation_scope="close/noallocation", - ) - - def test_ComputeNode_setAllocationScope_closed_noallocation_with_source_adm(self): - person = self.makePerson() - self.tic() - self.assertNotIn(person.getDefaultEmailCoordinateText(), [None, ""]) - - compute_node = self._test_ComputeNode_setAllocationScope_closed( - allocation_scope="close/noallocation", - source_administration=person.getRelativeUrl()) - - self.assertEqual(compute_node.getSubjectList(), [person.getDefaultEmailCoordinateText()]) - self.assertEqual(compute_node.getDestinationSectionList(), - [person.getRelativeUrl()]) \ No newline at end of file + ) \ No newline at end of file diff --git a/master/bt5/slapos_erp5/WorkflowTemplateItem/portal_workflow/slapos_erp5_interaction_workflow/script_ComputeNode_updateAllocation.py b/master/bt5/slapos_erp5/WorkflowTemplateItem/portal_workflow/slapos_erp5_interaction_workflow/script_ComputeNode_updateAllocation.py index 9c4bf8cd9213a3a05d2c1ec93d64f5f0b6121a07..e706a413ded757d8ab82715555ea64ea9b92d877 100644 --- a/master/bt5/slapos_erp5/WorkflowTemplateItem/portal_workflow/slapos_erp5_interaction_workflow/script_ComputeNode_updateAllocation.py +++ b/master/bt5/slapos_erp5/WorkflowTemplateItem/portal_workflow/slapos_erp5_interaction_workflow/script_ComputeNode_updateAllocation.py @@ -1,5 +1,4 @@ compute_node = state_object["object"] -allocation_scope = compute_node.getAllocationScope() edit_kw = {} @@ -12,28 +11,8 @@ if compute_node.getCapacityScope() != "close": if compute_node.getMonitorScope() is None: edit_kw['monitor_scope'] = 'enabled' -if allocation_scope == "close/forever": +if compute_node.getAllocationScope() == "close/forever": edit_kw['monitor_scope'] = 'disabled' -self_person = compute_node.getSourceAdministrationValue(portal_type="Person") -if self_person is None: +if edit_kw: compute_node.edit(**edit_kw) - return - -self_email = self_person.getDefaultEmailCoordinateText() -if allocation_scope in ['open/public', 'open/subscription']: - # reset friends and update in place - edit_kw['subject_list'] = [''] - edit_kw['destination_section'] = None -elif allocation_scope == 'open/personal': - # reset friends to self and update in place - edit_kw['subject_list'] = [self_email] - edit_kw['destination_section'] = self_person.getRelativeUrl() -else: - subject_list = compute_node.getSubjectList() - if self_email not in subject_list: - # add self as friend - subject_list.append(self_email) - edit_kw['subject_list'] = subject_list - -compute_node.edit(**edit_kw) diff --git a/master/bt5/slapos_erp5/WorkflowTemplateItem/portal_workflow/slapos_erp5_interaction_workflow/script_ComputeNode_updateAllocation.xml b/master/bt5/slapos_erp5/WorkflowTemplateItem/portal_workflow/slapos_erp5_interaction_workflow/script_ComputeNode_updateAllocation.xml index c370741a5436c2da4dfc425da19089ccfe7ce231..4e62d7f31086fd162d995d96624bb4403e3c8481 100644 --- a/master/bt5/slapos_erp5/WorkflowTemplateItem/portal_workflow/slapos_erp5_interaction_workflow/script_ComputeNode_updateAllocation.xml +++ b/master/bt5/slapos_erp5/WorkflowTemplateItem/portal_workflow/slapos_erp5_interaction_workflow/script_ComputeNode_updateAllocation.xml @@ -68,9 +68,7 @@ </item> <item> <key> <string>title</string> </key> - <value> - <none/> - </value> + <value> <string>None</string> </value> </item> </dictionary> </pickle> diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_compute_node_view_js.js b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_compute_node_view_js.js index aa81a924abe234e4836cbb265cd058dc5742d89d..9a21b48a6fdea5f588ae466bcab47ac32fe2675d 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_compute_node_view_js.js +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_compute_node_view_js.js @@ -105,14 +105,14 @@ "Closed for termination", "Closed forever", "Closed outdated", - "Open for Friends only", - "Open for Personal use only", + "Open for Friends only", // Not used anymore + "Open", "Open Public", "Open for Subscribers only", "Network", "Allocation Scope", "Monitoring", - "Your Friends email", + "Your Friends email", // Not used anymore "Upgrade", "The name of a document in ERP5", "Current Site", @@ -167,17 +167,23 @@ [results[2][10], 'auto'], [results[2][11], 'ask_confirmation'], [results[2][12], 'never']], + supported_allocation_scope_list = ['', + 'close/maintenance', + 'close/termination', + 'close/forever', + 'close/outdated', + 'close/noallocation', + 'open/personal'], allocation_scope_list = [['', ''], [results[2][13], 'close/maintenance'], [results[2][14], 'close/termination'], [results[2][15], 'close/forever'], [results[2][16], 'close/outdated'], [results[2][33], 'close/noallocation'], - [results[2][17], 'open/friend'], - [results[2][18], 'open/personal'], - [results[2][19], 'open/public'], - [results[2][20], 'open/subscription']], + [results[2][18], 'open/personal']], i, + hidden_allocation_scope = {'open/public': results[2][19], + 'open/subscription': results[2][20]}, len = results[1].data.total_rows; @@ -188,6 +194,17 @@ ]); } + if (!supported_allocation_scope_list.includes( + gadget.state.doc.allocation_scope + ) && hidden_allocation_scope.keys().includes( + gadget.state.doc.allocation_scope + )) { + allocation_scope_list.push( + [hidden_allocation_scope[gadget.state.doc.allocation_scope], + gadget.state.doc.allocation_scope + ] + ); + } return form_gadget.render({ erp5_document: { "_embedded": {"_view": { @@ -249,17 +266,6 @@ "hidden": 0, "type": "ListField" }, - "my_subject_list": { - "description": "", - "title": results[2][24], - "default": gadget.state.doc.subject_list, - "css_class": "", - "required": 1, - "editable": 1, - "key": "subject_list", - "hidden": (gadget.state.doc.allocation_scope === "open/friend") ? 0 : 1, - "type": "LinesField" - }, "my_upgrade_scope": { "description": "", "title": results[2][25], @@ -364,8 +370,7 @@ ], [ "right", [["my_source"], ["my_source_project"], ["my_monitor_scope"], - ["my_upgrade_scope"], ["my_allocation_scope"], - ["my_subject_list"]] + ["my_upgrade_scope"], ["my_allocation_scope"]] ], [ "bottom", [["ticket_listbox"], ["listbox"]] diff --git a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_compute_node_view_js.xml b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_compute_node_view_js.xml index 20639b6ec870802b5f0a146e2c71c3f191d1ac3b..2dc631f1c893af3a17d53391b8f0e1fc14bf053a 100644 --- a/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_compute_node_view_js.xml +++ b/master/bt5/slapos_jio/PathTemplateItem/web_page_module/rjs_gadget_erp5_page_slap_compute_node_view_js.xml @@ -267,7 +267,7 @@ </item> <item> <key> <string>serial</string> </key> - <value> <string>1006.16758.53785.31334</string> </value> + <value> <string>1006.26651.31767.25907</string> </value> </item> <item> <key> <string>state</string> </key> @@ -287,7 +287,7 @@ </tuple> <state> <tuple> - <float>1675971435.26</float> + <float>1676577476.87</float> <string>UTC</string> </tuple> </state> diff --git a/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getOpenComputeNodeList.py b/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getOpenComputeNodeList.py index 2537b09a4e3b4b1e125297ab5813b0e1117ab191..aafedf2907d5316bc81848951ce4c3c9831579e9 100644 --- a/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getOpenComputeNodeList.py +++ b/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/Base_getOpenComputeNodeList.py @@ -1,14 +1,12 @@ portal = context.getPortalObject() category_public = portal.restrictedTraverse("portal_categories/allocation_scope/open/public", None) -category_friend = portal.restrictedTraverse("portal_categories/allocation_scope/open/friend", None) category_personal = portal.restrictedTraverse("portal_categories/allocation_scope/open/personal", None) return portal.portal_catalog( portal_type='Compute Node', default_allocation_scope_uid=[ category_public.getUid(), - category_friend.getUid(), category_personal.getUid()], validation_state="validated", ) diff --git a/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputeNode_viewAsHateoas.xml b/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputeNode_viewAsHateoas.xml index 87fcd73b91094ed7843c3f2df94c19d5313b8e90..a7853acd64aa5158cb85ea333fe7ba5436d337b9 100644 --- a/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputeNode_viewAsHateoas.xml +++ b/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputeNode_viewAsHateoas.xml @@ -100,7 +100,6 @@ <string>my_title</string> <string>my_reference</string> <string>my_url_string</string> - <string>my_subject_list</string> <string>my_allocation_scope</string> <string>my_subordination</string> <string>my_news</string> diff --git a/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputeNode_viewAsHateoas/my_subject_list.xml b/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputeNode_viewAsHateoas/my_subject_list.xml deleted file mode 100644 index 59a4671549fc1f8c576f5e5cc01229e2e8d5460e..0000000000000000000000000000000000000000 --- a/master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/ComputeNode_viewAsHateoas/my_subject_list.xml +++ /dev/null @@ -1,84 +0,0 @@ -<?xml version="1.0"?> -<ZopeData> - <record id="1" aka="AAAAAAAAAAE="> - <pickle> - <global name="ProxyField" module="Products.ERP5Form.ProxyField"/> - </pickle> - <pickle> - <dictionary> - <item> - <key> <string>delegated_list</string> </key> - <value> - <list> - <string>title</string> - </list> - </value> - </item> - <item> - <key> <string>id</string> </key> - <value> <string>my_subject_list</string> </value> - </item> - <item> - <key> <string>message_values</string> </key> - <value> - <dictionary> - <item> - <key> <string>external_validator_failed</string> </key> - <value> <string>The input failed the external validator.</string> </value> - </item> - </dictionary> - </value> - </item> - <item> - <key> <string>overrides</string> </key> - <value> - <dictionary> - <item> - <key> <string>field_id</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>form_id</string> </key> - <value> <string></string> </value> - </item> - </dictionary> - </value> - </item> - <item> - <key> <string>tales</string> </key> - <value> - <dictionary> - <item> - <key> <string>field_id</string> </key> - <value> <string></string> </value> - </item> - <item> - <key> <string>form_id</string> </key> - <value> <string></string> </value> - </item> - </dictionary> - </value> - </item> - <item> - <key> <string>values</string> </key> - <value> - <dictionary> - <item> - <key> <string>field_id</string> </key> - <value> <string>my_string_field</string> </value> - </item> - <item> - <key> <string>form_id</string> </key> - <value> <string>Base_viewFieldLibrary</string> </value> - </item> - <item> - <key> <string>title</string> </key> - <value> <string>Friends (email)</string> </value> - </item> - </dictionary> - </value> - </item> - </dictionary> - </pickle> - </record> -</ZopeData> diff --git a/master/bt5/slapos_jio_ui_test/PathTemplateItem/portal_tests/slaposjs_zuite/testSlapOSJSServer.zpt b/master/bt5/slapos_jio_ui_test/PathTemplateItem/portal_tests/slaposjs_zuite/testSlapOSJSServer.zpt index 2cf34fa0c5e5dac94bf3874165f696997aea69a4..c7a421833f1b60a0eb47b1215cf5c92c52a95133 100644 --- a/master/bt5/slapos_jio_ui_test/PathTemplateItem/portal_tests/slaposjs_zuite/testSlapOSJSServer.zpt +++ b/master/bt5/slapos_jio_ui_test/PathTemplateItem/portal_tests/slaposjs_zuite/testSlapOSJSServer.zpt @@ -543,35 +543,11 @@ <tr> <td>select</td> <td>//select[@id="allocation_scope"]</td> - <td tal:content="python: '%s' % (here.Base_translateString('Open for Friends only', lang=lang))"></td> + <td tal:content="python: '%s' % (here.Base_translateString('Open', lang=lang))"></td> </tr> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/save" /> - <tr> - <td>waitForElementPresent</td> - <td>//textarea[@id="subject_list"]</td> - <td></td> - </tr> - <tr> - <td>assertElementPresent</td> - <td>//textarea[@id="subject_list"]</td> - <td></td> - </tr> - <tr> - <td>type</td> - <td>//textarea[@id="subject_list"]</td> - <td>demo@user.com</td> - </tr> - - <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/save" /> - - <tr> - <td>assertValue</td> - <td>//textarea[@id="subject_list"]</td> - <td>demo@user.com</td> - </tr> - <tal:block define="menu_item python: 'Servers'; header menu_item"> <tal:block metal:use-macro="here/Zuite_SlapOSCommonTemplate/macros/access_menu_item" /> </tal:block> diff --git a/master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMAlarm.py b/master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMAlarm.py index 336105d891273c1b01600c6af45e3178c60d367d..4f950dee6e785153f50ed46769ec2b129a7f2fd4 100644 --- a/master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMAlarm.py +++ b/master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMAlarm.py @@ -94,29 +94,30 @@ class TestSlapOSUpgradeDecisionProcess(SlapOSTestCaseMixin): def test_alarm_compute_node_create_upgrade_decision_auto(self): self._test_alarm_compute_node_create_upgrade_decision('open/public', 'auto') self._test_alarm_compute_node_create_upgrade_decision('open/personal', 'auto') - self._test_alarm_compute_node_create_upgrade_decision('open/friend', 'auto') self._test_alarm_compute_node_create_upgrade_decision('open/subscription', 'auto') self._test_alarm_compute_node_create_upgrade_decision('close/outdated', 'auto') self._test_alarm_compute_node_create_upgrade_decision('close/maintanance', 'auto') self._test_alarm_compute_node_create_upgrade_decision('close/termination', 'auto') + self._test_alarm_compute_node_create_upgrade_decision('close/noallocation', 'auto') def test_alarm_compute_node_create_upgrade_decision_ask_confirmation(self): self._test_alarm_compute_node_create_upgrade_decision('open/public', 'confirmation') self._test_alarm_compute_node_create_upgrade_decision('open/personal', 'confirmation') - self._test_alarm_compute_node_create_upgrade_decision('open/friend', 'confirmation') self._test_alarm_compute_node_create_upgrade_decision('open/subscription', 'confirmation') self._test_alarm_compute_node_create_upgrade_decision('close/outdated', 'confirmation') self._test_alarm_compute_node_create_upgrade_decision('close/maintanance', 'confirmation') self._test_alarm_compute_node_create_upgrade_decision('close/termination', 'confirmation') + self._test_alarm_compute_node_create_upgrade_decision('close/noallocation', 'confirmation') + def test_alarm_compute_node_create_upgrade_decision_never(self): self._test_alarm_compute_node_create_upgrade_decision_not_visited('open/public', 'never') self._test_alarm_compute_node_create_upgrade_decision_not_visited('open/personal', 'never') - self._test_alarm_compute_node_create_upgrade_decision_not_visited('open/friend', 'never') self._test_alarm_compute_node_create_upgrade_decision_not_visited('open/subscription', 'never') self._test_alarm_compute_node_create_upgrade_decision_not_visited('close/outdated', 'never') self._test_alarm_compute_node_create_upgrade_decision_not_visited('close/maintanance', 'never') self._test_alarm_compute_node_create_upgrade_decision_not_visited('close/termination', 'never') + self._test_alarm_compute_node_create_upgrade_decision_not_visited('close/noallocation', 'never') def test_alarm_instance_tree_create_upgrade_decision(self): instance_tree = self._makeInstanceTree()