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
Lisa Casino
slapos.core
Commits
b7d5041e
Commit
b7d5041e
authored
Jun 02, 2021
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_*: use the successor category instead of predecessor
parent
3eb3f76c
Changes
61
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
61 changed files
with
269 additions
and
269 deletions
+269
-269
master/bt5/slapos_cloud/ActionTemplateItem/portal_types/Slave%20Instance/jump_to_software_instance.xml
...rtal_types/Slave%20Instance/jump_to_software_instance.xml
+1
-1
master/bt5/slapos_cloud/ActionTemplateItem/portal_types/Software%20Instance/jump_to_software_instance.xml
...l_types/Software%20Instance/jump_to_software_instance.xml
+1
-1
master/bt5/slapos_cloud/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_successor_but_with_different_title_than_catalog_title.catalog_keys.xml
..._with_different_title_than_catalog_title.catalog_keys.xml
+0
-0
master/bt5/slapos_cloud/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_successor_but_with_different_title_than_catalog_title.sql
...successor_but_with_different_title_than_catalog_title.sql
+1
-1
master/bt5/slapos_cloud/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_successor_but_with_different_title_than_catalog_title.xml
...successor_but_with_different_title_than_catalog_title.xml
+2
-2
master/bt5/slapos_cloud/CatalogRelatedKeyTemplateItem/related_key_list.xml
..._cloud/CatalogRelatedKeyTemplateItem/related_key_list.xml
+1
-1
master/bt5/slapos_cloud/PathTemplateItem/portal_alarms/slapos_assert_hosting_subscription_successor.xml
...l_alarms/slapos_assert_hosting_subscription_successor.xml
+3
-3
master/bt5/slapos_cloud/PropertySheetTemplateItem/portal_property_sheets/SlaveInstanceConstraint/successor_related_constraint.xml
.../SlaveInstanceConstraint/successor_related_constraint.xml
+3
-3
master/bt5/slapos_cloud/PropertySheetTemplateItem/portal_property_sheets/SoftwareInstance/successor_category.xml
...l_property_sheets/SoftwareInstance/successor_category.xml
+1
-1
master/bt5/slapos_cloud/PropertySheetTemplateItem/portal_property_sheets/SoftwareInstanceConstraint/successor_related_constraint.xml
...ftwareInstanceConstraint/successor_related_constraint.xml
+3
-3
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Alarm_assertHostingSubscriptionHasSuccessor.py
...apos_cloud/Alarm_assertHostingSubscriptionHasSuccessor.py
+3
-3
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Alarm_assertHostingSubscriptionHasSuccessor.xml
...pos_cloud/Alarm_assertHostingSubscriptionHasSuccessor.xml
+1
-1
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Alarm_garbageCollectDestroyUnlinkedInstance.py
...apos_cloud/Alarm_garbageCollectDestroyUnlinkedInstance.py
+1
-1
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/HostingSubscription_assertSuccessor.py
...skins/slapos_cloud/HostingSubscription_assertSuccessor.py
+1
-1
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/HostingSubscription_assertSuccessor.xml
...kins/slapos_cloud/HostingSubscription_assertSuccessor.xml
+1
-1
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/HostingSubscription_view.xml
...em/portal_skins/slapos_cloud/HostingSubscription_view.xml
+1
-1
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/HostingSubscription_view/my_successor_title_list.xml
...loud/HostingSubscription_view/my_successor_title_list.xml
+2
-2
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SlaveInstance_view.xml
...lateItem/portal_skins/slapos_cloud/SlaveInstance_view.xml
+1
-1
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SlaveInstance_view/my_successor_title_list.xml
...apos_cloud/SlaveInstance_view/my_successor_title_list.xml
+3
-3
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_tryToGarbageCollect.py
...kins/slapos_cloud/SoftwareInstance_tryToGarbageCollect.py
+4
-4
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_tryToGarbageCollectNonAllocatedRootTree.py
...ftwareInstance_tryToGarbageCollectNonAllocatedRootTree.py
+2
-2
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_tryToGarbageUnlinkedInstance.py
...os_cloud/SoftwareInstance_tryToGarbageUnlinkedInstance.py
+4
-4
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_tryToStopCollect.py
...l_skins/slapos_cloud/SoftwareInstance_tryToStopCollect.py
+2
-2
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_view.xml
...eItem/portal_skins/slapos_cloud/SoftwareInstance_view.xml
+1
-1
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_view/my_successor_title_list.xml
...s_cloud/SoftwareInstance_view/my_successor_title_list.xml
+3
-3
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
...omponents/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
+2
-2
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
...teItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
+7
-7
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAlarm.py
...eItem/portal_components/test.erp5.testSlapOSCloudAlarm.py
+64
-64
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudConstraint.py
.../portal_components/test.erp5.testSlapOSCloudConstraint.py
+12
-12
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudWorkflow.py
...em/portal_components/test.erp5.testSlapOSCloudWorkflow.py
+24
-24
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/scripts/RequestedInstance_bangResquesterInstance.py
...kflow/scripts/RequestedInstance_bangResquesterInstance.py
+1
-1
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/scripts/RequesterInstance_request.py
...p_interface_workflow/scripts/RequesterInstance_request.py
+25
-25
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/interactions/SoftwareInstance_setSuccessorList.xml
...rkflow/interactions/SoftwareInstance_setSuccessorList.xml
+4
-4
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/scripts/SoftwareInstance_reindexRecursivelySuccessorSoftwareInstanceList.py
...stance_reindexRecursivelySuccessorSoftwareInstanceList.py
+1
-1
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/scripts/SoftwareInstance_reindexRecursivelySuccessorSoftwareInstanceList.xml
...tance_reindexRecursivelySuccessorSoftwareInstanceList.xml
+1
-1
master/bt5/slapos_cloud/bt/template_catalog_method_id_list
master/bt5/slapos_cloud/bt/template_catalog_method_id_list
+1
-1
master/bt5/slapos_cloud/bt/template_catalog_related_key_list
master/bt5/slapos_cloud/bt/template_catalog_related_key_list
+1
-1
master/bt5/slapos_cloud/bt/template_path_list
master/bt5/slapos_cloud/bt/template_path_list
+1
-1
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequestModule_getMonitoringUrlList.py
...m_monitoring/SupportRequestModule_getMonitoringUrlList.py
+1
-1
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_getInstanceMonitorUrl.py
...os_crm_monitoring/SupportRequest_getInstanceMonitorUrl.py
+1
-1
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
+10
-10
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/expected_alarm_tool_dumped_configuration.txt
...ministration/expected_alarm_tool_dumped_configuration.txt
+1
-1
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/expected_portal_skins_dumped_configuration.txt
...nistration/expected_portal_skins_dumped_configuration.txt
+3
-3
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/expected_property_sheet_dumped_configuration.txt
...stration/expected_property_sheet_dumped_configuration.txt
+10
-10
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/expected_type_actions_dumped_configuration.txt
...nistration/expected_type_actions_dumped_configuration.txt
+2
-2
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/HostingSubscription_getConnectionParameterList.py
...n_style/HostingSubscription_getConnectionParameterList.py
+1
-1
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/HostingSubscription_getMonitorParameterDict.py
...json_style/HostingSubscription_getMonitorParameterDict.py
+1
-1
master/bt5/slapos_jio_hateoas_backward_compatibility/SkinTemplateItem/portal_skins/slapos_hal_json_style_backward_compatibility/HostingSubscription_getHateoasRootSoftwareInstance.py
...ity/HostingSubscription_getHateoasRootSoftwareInstance.py
+1
-1
master/bt5/slapos_jio_hateoas_backward_compatibility/TestTemplateItem/portal_components/test.erp5.testSlapOSHypermediaSkins.py
.../portal_components/test.erp5.testSlapOSHypermediaSkins.py
+1
-1
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/HostingSubscription_createUpgradeDecision.py
...s/slapos_pdm/HostingSubscription_createUpgradeDecision.py
+1
-1
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/HostingSubscription_getNewerSofwareRelease.py
.../slapos_pdm/HostingSubscription_getNewerSofwareRelease.py
+1
-1
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/HostingSubscription_getUpgradableSoftwareRelease.py
...s_pdm/HostingSubscription_getUpgradableSoftwareRelease.py
+1
-1
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/HostingSubscription_isUpgradePossible.py
...skins/slapos_pdm/HostingSubscription_isUpgradePossible.py
+1
-1
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins.py
...ents/test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins.py
+8
-8
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMDestroySoftwareInstallationWithArchivedSoftwareReleaseAlarm.py
...oySoftwareInstallationWithArchivedSoftwareReleaseAlarm.py
+1
-1
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
+3
-3
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
...ateItem/portal_components/test.erp5.testSlapOSSlapTool.py
+13
-13
master/bt5/slapos_slap_tool/ToolComponentTemplateItem/portal_components/tool.erp5.SlapTool.py
...onentTemplateItem/portal_components/tool.erp5.SlapTool.py
+13
-13
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_processOrdered.py
...ubscription_request/SubscriptionRequest_processOrdered.py
+1
-1
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/TrialRequest_processDestroy.py
...lapos_subscription_request/TrialRequest_processDestroy.py
+1
-1
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSkins.py
...ortal_components/test.erp5.testSlapOSSubscriptionSkins.py
+3
-3
No files found.
master/bt5/slapos_cloud/ActionTemplateItem/portal_types/Slave%20Instance/jump_to_software_instance.xml
View file @
b7d5041e
...
...
@@ -79,7 +79,7 @@
<key>
<string>
text
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
string:${object_url}/Base_jumpToRelatedObject?base_category=
prede
cessor&portal_type=Software+Instance
string:${object_url}/Base_jumpToRelatedObject?base_category=
suc
cessor&portal_type=Software+Instance
]]>
</string>
</value>
</item>
...
...
master/bt5/slapos_cloud/ActionTemplateItem/portal_types/Software%20Instance/jump_to_software_instance.xml
View file @
b7d5041e
...
...
@@ -79,7 +79,7 @@
<key>
<string>
text
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
string:${object_url}/Base_jumpToRelatedObject?base_category=
prede
cessor&portal_type:list=Software+Instance&portal_type:list=Hosting+Subscription
string:${object_url}/Base_jumpToRelatedObject?base_category=
suc
cessor&portal_type:list=Software+Instance&portal_type:list=Hosting+Subscription
]]>
</string>
</value>
</item>
...
...
master/bt5/slapos_cloud/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_
prede
cessor_but_with_different_title_than_catalog_title.catalog_keys.xml
→
master/bt5/slapos_cloud/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_
suc
cessor_but_with_different_title_than_catalog_title.catalog_keys.xml
View file @
b7d5041e
File moved
master/bt5/slapos_cloud/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_
prede
cessor_but_with_different_title_than_catalog_title.sql
→
master/bt5/slapos_cloud/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_
suc
cessor_but_with_different_title_than_catalog_title.sql
View file @
b7d5041e
<
dtml
-
var
table_1
>
.
uid
=
<
dtml
-
var
table_0
>
.
category_uid
AND
<
dtml
-
var
table_0
>
.
base_category_uid
=
<
dtml
-
var
"portal_categories.
prede
cessor.getUid()"
>
AND
<
dtml
-
var
table_0
>
.
base_category_uid
=
<
dtml
-
var
"portal_categories.
suc
cessor.getUid()"
>
<
dtml
-
var
RELATED_QUERY_SEPARATOR
>
<
dtml
-
var
table_1
>
.
title
<>
<
dtml
-
var
query_table
>
.
title
AND
<
dtml
-
var
table_0
>
.
uid
=
<
dtml
-
var
query_table
>
.
uid
\ No newline at end of file
master/bt5/slapos_cloud/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_
prede
cessor_but_with_different_title_than_catalog_title.xml
→
master/bt5/slapos_cloud/CatalogMethodTemplateItem/portal_catalog/erp5_mysql_innodb/z_related_
suc
cessor_but_with_different_title_than_catalog_title.xml
View file @
b7d5041e
...
...
@@ -45,7 +45,7 @@ query_table="catalog"</string> </value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
z_related_
prede
cessor_but_with_different_title_than_catalog_title
</string>
</value>
<value>
<string>
z_related_
suc
cessor_but_with_different_title_than_catalog_title
</string>
</value>
</item>
<item>
<key>
<string>
max_cache_
</string>
</key>
...
...
@@ -61,7 +61,7 @@ query_table="catalog"</string> </value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
z_related_
prede
cessor_but_with_different_title_than_catalog_title
</string>
</value>
<value>
<string>
z_related_
suc
cessor_but_with_different_title_than_catalog_title
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
master/bt5/slapos_cloud/CatalogRelatedKeyTemplateItem/related_key_list.xml
View file @
b7d5041e
...
...
@@ -2,5 +2,5 @@
<key>
causality_subscription_request_related_uid | category,catalog/uid/z_related_causality_subscription_request
</key>
<key>
default_or_child_aggregate_reference | catalog,category,catalog/reference/z_related_default_or_child_aggregate
</key>
<key>
default_or_child_aggregate_uid | catalog,category,catalog/uid/z_related_default_or_child_aggregate
</key>
<key>
related_
predecessor_but_with_different_title_than_catalog_title | category,catalog/uid/z_related_prede
cessor_but_with_different_title_than_catalog_title
</key>
<key>
related_
successor_but_with_different_title_than_catalog_title | category,catalog/uid/z_related_suc
cessor_but_with_different_title_than_catalog_title
</key>
</key_list>
\ No newline at end of file
master/bt5/slapos_cloud/PathTemplateItem/portal_alarms/slapos_assert_hosting_subscription_
prede
cessor.xml
→
master/bt5/slapos_cloud/PathTemplateItem/portal_alarms/slapos_assert_hosting_subscription_
suc
cessor.xml
View file @
b7d5041e
...
...
@@ -8,7 +8,7 @@
<dictionary>
<item>
<key>
<string>
active_sense_method_id
</string>
</key>
<value>
<string>
Alarm_assertHostingSubscriptionHas
Prede
cessor
</string>
</value>
<value>
<string>
Alarm_assertHostingSubscriptionHas
Suc
cessor
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
...
...
@@ -22,7 +22,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
slapos_assert_hosting_subscription_
prede
cessor
</string>
</value>
<value>
<string>
slapos_assert_hosting_subscription_
suc
cessor
</string>
</value>
</item>
<item>
<key>
<string>
periodicity_hour
</string>
</key>
...
...
@@ -83,7 +83,7 @@
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Asserts that Hosting Subscription has
prede
cessor with same title
</string>
</value>
<value>
<string>
Asserts that Hosting Subscription has
suc
cessor with same title
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
master/bt5/slapos_cloud/PropertySheetTemplateItem/portal_property_sheets/SlaveInstanceConstraint/
prede
cessor_related_constraint.xml
→
master/bt5/slapos_cloud/PropertySheetTemplateItem/portal_property_sheets/SlaveInstanceConstraint/
suc
cessor_related_constraint.xml
View file @
b7d5041e
...
...
@@ -28,17 +28,17 @@
<key>
<string>
expression
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
python: len(context.get
Prede
cessorRelatedList()) <= 1
python: len(context.get
Suc
cessorRelatedList()) <= 1
]]>
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
prede
cessor_related_constraint
</string>
</value>
<value>
<string>
suc
cessor_related_constraint
</string>
</value>
</item>
<item>
<key>
<string>
message_expression_false
</string>
</key>
<value>
<string>
There is more then one related
prede
cessor
</string>
</value>
<value>
<string>
There is more then one related
suc
cessor
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
...
...
master/bt5/slapos_cloud/PropertySheetTemplateItem/portal_property_sheets/SoftwareInstance/
prede
cessor_category.xml
→
master/bt5/slapos_cloud/PropertySheetTemplateItem/portal_property_sheets/SoftwareInstance/
suc
cessor_category.xml
View file @
b7d5041e
...
...
@@ -8,7 +8,7 @@
<dictionary>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
prede
cessor_category
</string>
</value>
<value>
<string>
suc
cessor_category
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
...
...
master/bt5/slapos_cloud/PropertySheetTemplateItem/portal_property_sheets/SoftwareInstanceConstraint/
prede
cessor_related_constraint.xml
→
master/bt5/slapos_cloud/PropertySheetTemplateItem/portal_property_sheets/SoftwareInstanceConstraint/
suc
cessor_related_constraint.xml
View file @
b7d5041e
...
...
@@ -28,17 +28,17 @@
<key>
<string>
expression
</string>
</key>
<value>
<string
encoding=
"cdata"
>
<![CDATA[
python: len(context.get
Prede
cessorRelatedList()) <= 1
python: len(context.get
Suc
cessorRelatedList()) <= 1
]]>
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
prede
cessor_related_constraint
</string>
</value>
<value>
<string>
suc
cessor_related_constraint
</string>
</value>
</item>
<item>
<key>
<string>
message_expression_false
</string>
</key>
<value>
<string>
There is more then one related
prede
cessor
</string>
</value>
<value>
<string>
There is more then one related
suc
cessor
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Alarm_assertHostingSubscriptionHas
Prede
cessor.py
→
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Alarm_assertHostingSubscriptionHas
Suc
cessor.py
View file @
b7d5041e
...
...
@@ -4,9 +4,9 @@ from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, NegatedQuery
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
'Hosting Subscription'
,
validation_state
=
'validated'
,
related_
prede
cessor_but_with_different_title_than_catalog_title
=
"%"
,
predecessor_title
=
NegatedQuery
(
SimpleQuery
(
prede
cessor_title
=
None
,
comparison_operator
=
'is'
)),
method_id
=
'HostingSubscription_assert
Prede
cessor'
,
related_
suc
cessor_but_with_different_title_than_catalog_title
=
"%"
,
successor_title
=
NegatedQuery
(
SimpleQuery
(
suc
cessor_title
=
None
,
comparison_operator
=
'is'
)),
method_id
=
'HostingSubscription_assert
Suc
cessor'
,
activate_kw
=
{
'tag'
:
tag
})
context
.
activate
(
after_tag
=
tag
).
getId
()
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Alarm_assertHostingSubscriptionHas
Prede
cessor.xml
→
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Alarm_assertHostingSubscriptionHas
Suc
cessor.xml
View file @
b7d5041e
...
...
@@ -54,7 +54,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Alarm_assertHostingSubscriptionHas
Prede
cessor
</string>
</value>
<value>
<string>
Alarm_assertHostingSubscriptionHas
Suc
cessor
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/Alarm_garbageCollectDestroyUnlinkedInstance.py
View file @
b7d5041e
...
...
@@ -5,7 +5,7 @@ portal.portal_catalog.searchAndActivate(
portal_type
=
[
"Software Instance"
,
"Slave Instance"
],
validation_state
=
"validated"
,
specialise_validation_state
=
"validated"
,
predecessor_related_uid
=
SimpleQuery
(
prede
cessor_related_uid
=
None
,
comparison_operator
=
'is'
),
successor_related_uid
=
SimpleQuery
(
suc
cessor_related_uid
=
None
,
comparison_operator
=
'is'
),
method_id
=
'SoftwareInstance_tryToGarbageUnlinkedInstance'
,
activate_kw
=
{
'tag'
:
tag
}
)
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/HostingSubscription_assert
Prede
cessor.py
→
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/HostingSubscription_assert
Suc
cessor.py
View file @
b7d5041e
if
context
.
getPortalType
()
!=
'Hosting Subscription'
\
or
context
.
getValidationState
()
!=
'validated'
\
or
context
.
getSlapState
()
not
in
[
'start_requested'
,
'stop_requested'
]
\
or
context
.
getTitle
()
in
context
.
get
Prede
cessorTitleList
():
or
context
.
getTitle
()
in
context
.
get
Suc
cessorTitleList
():
# nothing to do
return
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/HostingSubscription_assert
Prede
cessor.xml
→
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/HostingSubscription_assert
Suc
cessor.xml
View file @
b7d5041e
...
...
@@ -54,7 +54,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
HostingSubscription_assert
Prede
cessor
</string>
</value>
<value>
<string>
HostingSubscription_assert
Suc
cessor
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/HostingSubscription_view.xml
View file @
b7d5041e
...
...
@@ -116,7 +116,7 @@
<key>
<string>
right
</string>
</key>
<value>
<list>
<string>
my_
prede
cessor_title_list
</string>
<string>
my_
suc
cessor_title_list
</string>
<string>
my_destination_section_title
</string>
<string>
my_translated_slap_state_title
</string>
<string>
my_translated_validation_state_title
</string>
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/HostingSubscription_view/my_
prede
cessor_title_list.xml
→
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/HostingSubscription_view/my_
suc
cessor_title_list.xml
View file @
b7d5041e
...
...
@@ -18,7 +18,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_
prede
cessor_title_list
</string>
</value>
<value>
<string>
my_
suc
cessor_title_list
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
...
...
@@ -106,7 +106,7 @@
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Prede
cessors
</string>
</value>
<value>
<string>
Suc
cessors
</string>
</value>
</item>
</dictionary>
</value>
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SlaveInstance_view.xml
View file @
b7d5041e
...
...
@@ -112,7 +112,7 @@
<string>
my_specialise_title
</string>
<string>
my_aggregate_parent_reference
</string>
<string>
my_aggregate_title
</string>
<string>
my_
prede
cessor_title_list
</string>
<string>
my_
suc
cessor_title_list
</string>
<string>
my_translated_slap_state_title
</string>
<string>
my_translated_validation_state_title
</string>
</list>
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SlaveInstance_view/my_
prede
cessor_title_list.xml
→
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SlaveInstance_view/my_
suc
cessor_title_list.xml
View file @
b7d5041e
...
...
@@ -19,7 +19,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_
prede
cessor_title_list
</string>
</value>
<value>
<string>
my_
suc
cessor_title_list
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
...
...
@@ -76,7 +76,7 @@
<dictionary>
<item>
<key>
<string>
base_category
</string>
</key>
<value>
<string>
prede
cessor
</string>
</value>
<value>
<string>
suc
cessor
</string>
</value>
</item>
<item>
<key>
<string>
catalog_index
</string>
</key>
...
...
@@ -107,7 +107,7 @@
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Prede
cessors
</string>
</value>
<value>
<string>
Suc
cessors
</string>
</value>
</item>
</dictionary>
</value>
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_tryToGarbageCollect.py
View file @
b7d5041e
...
...
@@ -4,7 +4,7 @@ if (instance.getSlapState() != "destroy_requested"):
hosting_subscription
=
instance
.
getSpecialiseValue
(
portal_type
=
"Hosting Subscription"
)
if
(
hosting_subscription
.
getValidationState
()
==
"archived"
):
# Buildout didn't propagate the destruction request
requester
=
instance
.
get
Prede
cessorRelatedValue
()
requester
=
instance
.
get
Suc
cessorRelatedValue
()
if
instance
.
getPortalType
()
==
'Software Instance'
:
is_slave
=
False
...
...
@@ -15,7 +15,7 @@ if (instance.getSlapState() != "destroy_requested"):
(
instance
.
getPortalType
(),
instance
.
getRelativeUrl
())
if
requester
is
None
:
# This instance has no
prede
cessor (link removed) and should be trashed
# This instance has no
suc
cessor (link removed) and should be trashed
promise_kw
=
{
'instance_xml'
:
instance
.
getTextContent
(),
'software_type'
:
instance
.
getSourceReference
(),
...
...
@@ -25,8 +25,8 @@ if (instance.getSlapState() != "destroy_requested"):
}
instance
.
requestDestroy
(
**
promise_kw
)
# Unlink all children of this instance
instance
.
edit
(
prede
cessor
=
""
,
comment
=
"Destroyed garbage collector!"
)
elif
(
instance
.
getRelativeUrl
()
in
requester
.
get
Prede
cessorList
())
and
\
instance
.
edit
(
suc
cessor
=
""
,
comment
=
"Destroyed garbage collector!"
)
elif
(
instance
.
getRelativeUrl
()
in
requester
.
get
Suc
cessorList
())
and
\
(
requester
.
getSlapState
()
==
"destroy_requested"
):
# For security, only destroyed if parent is also destroyed
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_tryToGarbageCollectNonAllocatedRootTree.py
View file @
b7d5041e
...
...
@@ -22,9 +22,9 @@ if (int(DateTime()) - int(latest_edit_time)) < 259200:
# Only destroy if the instance is the only one in the tree
hosting_subscription
=
instance
.
getSpecialiseValue
(
"Hosting Subscription"
)
if
(
hosting_subscription
.
get
Prede
cessor
()
!=
instance
.
getRelativeUrl
()):
if
(
hosting_subscription
.
get
Suc
cessor
()
!=
instance
.
getRelativeUrl
()):
return
if
(
len
(
hosting_subscription
.
get
Prede
cessorList
())
!=
1
):
if
(
len
(
hosting_subscription
.
get
Suc
cessorList
())
!=
1
):
return
instance_list
=
portal
.
portal_catalog
(
portal_type
=
[
"Software Instance"
,
"Slave Instance"
],
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_tryToGarbageUnlinkedInstance.py
View file @
b7d5041e
...
...
@@ -8,7 +8,7 @@ instance = context
def
checkInstanceTree
(
instance_list
):
"""
Check if
prede
cessor link is really removed to this instance
Check if
suc
cessor link is really removed to this instance
"""
sub_instance_list
=
[]
if
instance_list
==
[]:
...
...
@@ -16,7 +16,7 @@ def checkInstanceTree(instance_list):
for
item
in
instance_list
:
if
item
.
getUid
()
==
instance
.
getUid
():
return
item
sub_instance_list
.
extend
(
item
.
get
Prede
cessorValueList
())
sub_instance_list
.
extend
(
item
.
get
Suc
cessorValueList
())
return
checkInstanceTree
(
sub_instance_list
)
...
...
@@ -28,7 +28,7 @@ if hosting_subscription is None or \
hosting_subscription
.
getSlapState
()
==
"destroy_requested"
:
return
root_instance
=
hosting_subscription
.
get
Prede
cessorValue
()
root_instance
=
hosting_subscription
.
get
Suc
cessorValue
()
if
root_instance
is
None
:
# Refuse to destroy root instance
raise
ValueError
(
"Hosting Subscription %s has no root instance, this should "
\
...
...
@@ -53,6 +53,6 @@ if checkInstanceTree([root_instance]) is None:
}
instance
.
requestDestroy
(
**
promise_kw
)
# Unlink all children of this instance
instance
.
edit
(
prede
cessor
=
""
,
comment
=
"Destroyed garbage collector!"
)
instance
.
edit
(
suc
cessor
=
""
,
comment
=
"Destroyed garbage collector!"
)
return
instance
.
getRelativeUrl
()
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_tryToStopCollect.py
View file @
b7d5041e
...
...
@@ -8,8 +8,8 @@ if (instance.getSlapState() == "start_requested"):
hosting_subscription
=
instance
.
getSpecialiseValue
(
portal_type
=
"Hosting Subscription"
)
if
(
hosting_subscription
.
getSlapState
()
==
"stop_requested"
):
# Buildout may not propagate the stop request
requester
=
instance
.
get
Prede
cessorRelatedValue
()
if
(
instance
.
getRelativeUrl
()
in
requester
.
get
Prede
cessorList
())
and
\
requester
=
instance
.
get
Suc
cessorRelatedValue
()
if
(
instance
.
getRelativeUrl
()
in
requester
.
get
Suc
cessorList
())
and
\
(
requester
.
getSlapState
()
==
"stop_requested"
):
# For security, only stop if parent is also stopped
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_view.xml
View file @
b7d5041e
...
...
@@ -116,7 +116,7 @@
<string>
my_specialise_title
</string>
<string>
my_aggregate_parent_reference
</string>
<string>
my_aggregate_title
</string>
<string>
my_
prede
cessor_title_list
</string>
<string>
my_
suc
cessor_title_list
</string>
<string>
my_translated_slap_state_title
</string>
<string>
my_translated_validation_state_title
</string>
</list>
...
...
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_view/my_
prede
cessor_title_list.xml
→
master/bt5/slapos_cloud/SkinTemplateItem/portal_skins/slapos_cloud/SoftwareInstance_view/my_
suc
cessor_title_list.xml
View file @
b7d5041e
...
...
@@ -19,7 +19,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
my_
prede
cessor_title_list
</string>
</value>
<value>
<string>
my_
suc
cessor_title_list
</string>
</value>
</item>
<item>
<key>
<string>
message_values
</string>
</key>
...
...
@@ -76,7 +76,7 @@
<dictionary>
<item>
<key>
<string>
base_category
</string>
</key>
<value>
<string>
prede
cessor
</string>
</value>
<value>
<string>
suc
cessor
</string>
</value>
</item>
<item>
<key>
<string>
catalog_index
</string>
</key>
...
...
@@ -111,7 +111,7 @@
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Prede
cessors
</string>
</value>
<value>
<string>
Suc
cessors
</string>
</value>
</item>
</dictionary>
</value>
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseDefaultScenarioMixin.py
View file @
b7d5041e
...
...
@@ -356,7 +356,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
self
.
assertEqual
(
1
,
len
(
hosting_subscription_list
))
hosting_subscription
=
hosting_subscription_list
[
0
]
software_instance
=
hosting_subscription
.
get
Prede
cessorValue
()
software_instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
assertEqual
(
software_instance
.
getTitle
(),
hosting_subscription
.
getTitle
())
connection_dict
=
software_instance
.
getConnectionXmlAsDict
()
...
...
@@ -523,7 +523,7 @@ class DefaultScenarioMixin(TestSlapOSSecurityMixin):
self
.
assertEqual
(
1
,
len
(
hosting_subscription_list
))
hosting_subscription
=
hosting_subscription_list
[
0
]
software_instance
=
hosting_subscription
.
get
Prede
cessorValue
()
software_instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
assertEqual
(
software_instance
.
getTitle
(),
hosting_subscription
.
getTitle
())
connection_dict
=
software_instance
.
getConnectionXmlAsDict
()
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.SlapOSTestCaseMixin.py
View file @
b7d5041e
...
...
@@ -215,7 +215,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
text_content
=
self
.
request_kw
[
'instance_xml'
],
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
root_slave
=
self
.
request_kw
[
'shared'
],
prede
cessor
=
self
.
software_instance
.
getRelativeUrl
(),
suc
cessor
=
self
.
software_instance
.
getRelativeUrl
(),
destination_section
=
self
.
person_user
.
getRelativeUrl
()
)
self
.
hosting_subscription
.
validate
()
...
...
@@ -231,7 +231,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
text_content
=
self
.
request_kw
[
'instance_xml'
],
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
specialise
=
self
.
hosting_subscription
.
getRelativeUrl
(),
prede
cessor
=
self
.
requested_software_instance
.
getRelativeUrl
()
suc
cessor
=
self
.
requested_software_instance
.
getRelativeUrl
()
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
self
.
software_instance
,
'start_requested'
)
self
.
software_instance
.
validate
()
...
...
@@ -368,7 +368,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
hosting_subscription
.
requestStart
(
**
kw
)
hosting_subscription
.
requestInstance
(
**
kw
)
self
.
start_requested_software_instance
=
hosting_subscription
.
get
Prede
cessorValue
()
self
.
start_requested_software_instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
start_requested_software_instance
.
edit
(
aggregate
=
self
.
computer
.
partition1
.
getRelativeUrl
())
if
with_slave
:
...
...
@@ -392,7 +392,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
hosting_subscription
.
requestStart
(
**
slave_kw
)
hosting_subscription
.
requestInstance
(
**
slave_kw
)
self
.
start_requested_slave_instance
=
hosting_subscription
.
get
Prede
cessorValue
()
self
.
start_requested_slave_instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
start_requested_slave_instance
.
edit
(
aggregate
=
self
.
computer
.
partition1
.
getRelativeUrl
())
hosting_subscription
=
self
.
portal
.
hosting_subscription_module
\
...
...
@@ -416,7 +416,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
hosting_subscription
.
requestStop
(
**
kw
)
hosting_subscription
.
requestInstance
(
**
kw
)
self
.
stop_requested_software_instance
=
hosting_subscription
.
get
Prede
cessorValue
()
self
.
stop_requested_software_instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
stop_requested_software_instance
.
edit
(
aggregate
=
self
.
computer
.
partition2
.
getRelativeUrl
()
)
...
...
@@ -444,7 +444,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
kw
[
'state'
]
=
'destroyed'
hosting_subscription
.
requestDestroy
(
**
kw
)
self
.
destroy_requested_software_instance
=
hosting_subscription
.
get
Prede
cessorValue
()
self
.
destroy_requested_software_instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
destroy_requested_software_instance
.
requestDestroy
(
**
kw
)
self
.
destroy_requested_software_instance
.
edit
(
aggregate
=
self
.
computer
.
partition3
.
getRelativeUrl
()
...
...
@@ -473,7 +473,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
kw
[
'state'
]
=
'destroyed'
hosting_subscription
.
requestDestroy
(
**
kw
)
self
.
destroyed_software_instance
=
hosting_subscription
.
get
Prede
cessorValue
()
self
.
destroyed_software_instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
destroyed_software_instance
.
edit
(
aggregate
=
self
.
computer
.
partition4
.
getRelativeUrl
()
)
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudAlarm.py
View file @
b7d5041e
This diff is collapsed.
Click to expand it.
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudConstraint.py
View file @
b7d5041e
...
...
@@ -235,7 +235,7 @@ class TestSlapOSSoftwareInstanceConstraint(TestSlapOSConstraintMixin):
self
.
software_instance
.
edit
(
**
{
property_id
:
''
})
self
.
assertFalse
(
consistency_message
in
self
.
getMessageList
(
self
.
software_instance
))
def
test_
prede
cessor_related
(
self
):
def
test_
suc
cessor_related
(
self
):
software_instance2
=
self
.
portal
.
software_instance_module
.
newContent
(
portal_type
=
'Software Instance'
)
software_instance3
=
self
.
portal
.
software_instance_module
.
newContent
(
...
...
@@ -244,25 +244,25 @@ class TestSlapOSSoftwareInstanceConstraint(TestSlapOSConstraintMixin):
# fetch basic list of consistency messages
current_message_list
=
self
.
getMessageList
(
self
.
software_instance
)
consistency_message
=
"There is more then one related
prede
cessor"
consistency_message
=
"There is more then one related
suc
cessor"
# test the test: no expected message found
self
.
assertFalse
(
consistency_message
in
current_message_list
)
# if too many, it shall cry
software_instance2
.
edit
(
prede
cessor
=
self
.
software_instance
.
getRelativeUrl
())
software_instance3
.
edit
(
prede
cessor
=
self
.
software_instance
.
getRelativeUrl
())
software_instance2
.
edit
(
suc
cessor
=
self
.
software_instance
.
getRelativeUrl
())
software_instance3
.
edit
(
suc
cessor
=
self
.
software_instance
.
getRelativeUrl
())
self
.
tic
()
self
.
assertTrue
(
consistency_message
in
self
.
getMessageList
(
self
.
software_instance
))
# one is good
software_instance2
.
edit
(
prede
cessor
=
None
)
software_instance2
.
edit
(
suc
cessor
=
None
)
self
.
tic
()
self
.
assertFalse
(
consistency_message
in
self
.
getMessageList
(
self
.
software_instance
))
self
.
assertSameSet
(
current_message_list
,
self
.
getMessageList
(
self
.
software_instance
))
# none is good
software_instance3
.
edit
(
prede
cessor
=
None
)
software_instance3
.
edit
(
suc
cessor
=
None
)
self
.
tic
()
self
.
assertFalse
(
consistency_message
in
self
.
getMessageList
(
self
.
software_instance
))
self
.
assertSameSet
(
current_message_list
,
self
.
getMessageList
(
self
.
software_instance
))
...
...
@@ -374,7 +374,7 @@ class TestSlapOSSlaveInstanceConstraint(TestSlapOSConstraintMixin):
'Property existence error for property reference, this document'
' has no such property or the property has never been set'
)
def
test_
prede
cessor_related
(
self
):
def
test_
suc
cessor_related
(
self
):
software_instance2
=
self
.
portal
.
software_instance_module
.
newContent
(
portal_type
=
'Slave Instance'
)
software_instance3
=
self
.
portal
.
software_instance_module
.
newContent
(
...
...
@@ -383,25 +383,25 @@ class TestSlapOSSlaveInstanceConstraint(TestSlapOSConstraintMixin):
# fetch basic list of consistency messages
current_message_list
=
self
.
getMessageList
(
self
.
software_instance
)
consistency_message
=
"There is more then one related
prede
cessor"
consistency_message
=
"There is more then one related
suc
cessor"
# test the test: no expected message found
self
.
assertFalse
(
consistency_message
in
current_message_list
)
# if too many, it shall cry
software_instance2
.
edit
(
prede
cessor
=
self
.
software_instance
.
getRelativeUrl
())
software_instance3
.
edit
(
prede
cessor
=
self
.
software_instance
.
getRelativeUrl
())
software_instance2
.
edit
(
suc
cessor
=
self
.
software_instance
.
getRelativeUrl
())
software_instance3
.
edit
(
suc
cessor
=
self
.
software_instance
.
getRelativeUrl
())
self
.
tic
()
self
.
assertTrue
(
consistency_message
in
self
.
getMessageList
(
self
.
software_instance
))
# one is good
software_instance2
.
edit
(
prede
cessor
=
None
)
software_instance2
.
edit
(
suc
cessor
=
None
)
self
.
tic
()
self
.
assertFalse
(
consistency_message
in
self
.
getMessageList
(
self
.
software_instance
))
self
.
assertSameSet
(
current_message_list
,
self
.
getMessageList
(
self
.
software_instance
))
# none is good
software_instance3
.
edit
(
prede
cessor
=
None
)
software_instance3
.
edit
(
suc
cessor
=
None
)
self
.
tic
()
self
.
assertFalse
(
consistency_message
in
self
.
getMessageList
(
self
.
software_instance
))
self
.
assertSameSet
(
current_message_list
,
self
.
getMessageList
(
self
.
software_instance
))
...
...
master/bt5/slapos_cloud/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudWorkflow.py
View file @
b7d5041e
...
...
@@ -699,7 +699,7 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin):
hosting_subscription
.
requestStart
(
**
self
.
request_kw
)
hosting_subscription
.
requestInstance
(
**
self
.
request_kw
)
self
.
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
self
.
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
tic
()
def
_countInstanceBang
(
self
,
instance
,
comment
):
...
...
@@ -1102,7 +1102,7 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
text_content
=
self
.
request_kw
[
'instance_xml'
],
sla_xml
=
self
.
request_kw
[
'sla_xml'
],
root_slave
=
self
.
request_kw
[
'shared'
],
prede
cessor
=
self
.
software_instance
.
getRelativeUrl
()
suc
cessor
=
self
.
software_instance
.
getRelativeUrl
()
)
hosting_subscription
.
validate
()
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
hosting_subscription
,
'start_requested'
)
...
...
@@ -1357,7 +1357,7 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
self
.
software_instance
.
getSpecialiseValue
(
portal_type
=
'Hosting Subscription'
).
edit
(
prede
cessor_list
=
[
suc
cessor_list
=
[
duplicate
.
getRelativeUrl
(),
duplicate2
.
getRelativeUrl
(),
self
.
software_instance
.
getRelativeUrl
()
...
...
@@ -1405,7 +1405,7 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
requested_instance2
.
getRelativeUrl
())
self
.
assertSameSet
(
self
.
software_instance
.
get
Prede
cessorList
(),
self
.
software_instance
.
get
Suc
cessorList
(),
[
requested_instance
.
getRelativeUrl
(),
requested_instance2
.
getRelativeUrl
()])
...
...
@@ -1440,7 +1440,7 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
C_instance
=
self
.
software_instance
.
REQUEST
.
get
(
'request_instance'
)
self
.
assertSameSet
(
self
.
software_instance
.
get
Prede
cessorList
(),
self
.
software_instance
.
get
Suc
cessorList
(),
[
B_instance
.
getRelativeUrl
(),
C_instance
.
getRelativeUrl
()])
self
.
tic
()
# in order to recalculate tree
...
...
@@ -1450,9 +1450,9 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
self
.
assertEqual
(
C_instance
.
getRelativeUrl
(),
C1_instance
.
getRelativeUrl
())
self
.
assertSameSet
(
self
.
software_instance
.
get
Prede
cessorList
(),
self
.
assertSameSet
(
self
.
software_instance
.
get
Suc
cessorList
(),
[
B_instance
.
getRelativeUrl
()])
self
.
assertSameSet
(
B_instance
.
get
Prede
cessorList
(),
self
.
assertSameSet
(
B_instance
.
get
Suc
cessorList
(),
[
C_instance
.
getRelativeUrl
()])
def
test_request_tree_change_not_indexed
(
self
):
...
...
@@ -1479,7 +1479,7 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
C_instance
=
self
.
software_instance
.
REQUEST
.
get
(
'request_instance'
)
self
.
assertSameSet
(
self
.
software_instance
.
get
Prede
cessorList
(),
self
.
software_instance
.
get
Suc
cessorList
(),
[
B_instance
.
getRelativeUrl
(),
C_instance
.
getRelativeUrl
()])
transaction
.
commit
()
...
...
@@ -1512,7 +1512,7 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
C_instance
=
self
.
software_instance
.
REQUEST
.
get
(
'request_instance'
)
self
.
assertSameSet
(
self
.
software_instance
.
get
Prede
cessorList
(),
self
.
software_instance
.
get
Suc
cessorList
(),
[
B_instance
.
getRelativeUrl
(),
C_instance
.
getRelativeUrl
()])
self
.
assertRaises
(
NotImplementedError
,
B_instance
.
requestInstance
,
...
...
@@ -1582,7 +1582,7 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
# in case of destruction instance is not returned, so fetch it
# directly form document
requested_instance3
=
self
.
software_instance
.
get
Prede
cessorValue
(
requested_instance3
=
self
.
software_instance
.
get
Suc
cessorValue
(
portal_type
=
'Software Instance'
)
self
.
assertEqual
(
request_kw
[
'software_title'
],
requested_instance3
.
getTitle
())
...
...
@@ -1665,7 +1665,7 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
request_kw
[
'state'
]
=
'destroyed'
self
.
software_instance
.
requestInstance
(
**
request_kw
)
transaction
.
commit
()
requested_instance2
=
self
.
software_instance
.
get
Prede
cessorValue
(
requested_instance2
=
self
.
software_instance
.
get
Suc
cessorValue
(
portal_type
=
'Software Instance'
)
self
.
assertEqual
(
requested_instance
.
getRelativeUrl
(),
...
...
@@ -1704,7 +1704,7 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
C_instance
=
self
.
software_instance
.
REQUEST
.
get
(
'request_instance'
)
self
.
assertSameSet
(
self
.
software_instance
.
get
Prede
cessorList
(),
self
.
software_instance
.
get
Suc
cessorList
(),
[
B_instance
.
getRelativeUrl
(),
C_instance
.
getRelativeUrl
()])
self
.
tic
()
# in order to recalculate tree
...
...
@@ -1714,9 +1714,9 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
self
.
assertEqual
(
C_instance
.
getRelativeUrl
(),
C1_instance
.
getRelativeUrl
())
self
.
assertSameSet
(
self
.
software_instance
.
get
Prede
cessorList
(),
self
.
assertSameSet
(
self
.
software_instance
.
get
Suc
cessorList
(),
[
B_instance
.
getRelativeUrl
()])
self
.
assertSameSet
(
B_instance
.
get
Prede
cessorList
(),
self
.
assertSameSet
(
B_instance
.
get
Suc
cessorList
(),
[
C_instance
.
getRelativeUrl
()])
def
test_request_tree_change_not_indexed_shared
(
self
):
...
...
@@ -1744,7 +1744,7 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
C_instance
=
self
.
software_instance
.
REQUEST
.
get
(
'request_instance'
)
self
.
assertSameSet
(
self
.
software_instance
.
get
Prede
cessorList
(),
self
.
software_instance
.
get
Suc
cessorList
(),
[
B_instance
.
getRelativeUrl
(),
C_instance
.
getRelativeUrl
()])
transaction
.
commit
()
...
...
@@ -1778,7 +1778,7 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
C_instance
=
self
.
software_instance
.
REQUEST
.
get
(
'request_instance'
)
self
.
assertSameSet
(
self
.
software_instance
.
get
Prede
cessorList
(),
self
.
software_instance
.
get
Suc
cessorList
(),
[
B_instance
.
getRelativeUrl
(),
C_instance
.
getRelativeUrl
()])
self
.
assertRaises
(
NotImplementedError
,
B_instance
.
requestInstance
,
...
...
@@ -1799,7 +1799,7 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
request_kw
[
'software_release'
]
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
software_instance
.
requestInstance
(
**
request_kw
)
requested_instance2
=
self
.
software_instance
.
get
Prede
cessorValue
(
requested_instance2
=
self
.
software_instance
.
get
Suc
cessorValue
(
portal_type
=
'Software Instance'
)
transaction
.
commit
()
...
...
@@ -1825,7 +1825,7 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
request_kw
[
'software_type'
]
=
self
.
generateNewSoftwareReleaseUrl
()
self
.
software_instance
.
requestInstance
(
**
request_kw
)
requested_instance2
=
self
.
software_instance
.
get
Prede
cessorValue
(
requested_instance2
=
self
.
software_instance
.
get
Suc
cessorValue
(
portal_type
=
'Software Instance'
)
transaction
.
commit
()
...
...
@@ -1851,7 +1851,7 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
request_kw
[
'instance_xml'
]
=
self
.
generateSafeXml
()
self
.
software_instance
.
requestInstance
(
**
request_kw
)
requested_instance2
=
self
.
software_instance
.
get
Prede
cessorValue
(
requested_instance2
=
self
.
software_instance
.
get
Suc
cessorValue
(
portal_type
=
'Software Instance'
)
transaction
.
commit
()
...
...
@@ -1877,7 +1877,7 @@ class TestSlapOSCoreSoftwareInstanceRequest(SlapOSTestCaseMixin):
request_kw
[
'sla_xml'
]
=
self
.
generateSafeXml
()
self
.
software_instance
.
requestInstance
(
**
request_kw
)
requested_instance2
=
self
.
software_instance
.
get
Prede
cessorValue
(
requested_instance2
=
self
.
software_instance
.
get
Suc
cessorValue
(
portal_type
=
'Software Instance'
)
transaction
.
commit
()
...
...
@@ -2914,7 +2914,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
return
self
.
check_change_instance_parameter
(
"Slave Instance"
,
'sla_xml'
)
def
test_SoftwareInstance_set
Prede
cessorList
(
self
):
def
test_SoftwareInstance_set
Suc
cessorList
(
self
):
portal_type
=
"Software Instance"
self
.
person_user
=
self
.
makePerson
()
...
...
@@ -2938,7 +2938,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
destination_reference
=
"TESTINST-%s"
%
new_id
,
ssl_certificate
=
"foo"
,
ssl_key
=
"bar"
,
prede
cessor_value
=
instance3
,
suc
cessor_value
=
instance3
,
)
new_id
=
self
.
generateNewId
()
...
...
@@ -2949,7 +2949,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
destination_reference
=
"TESTINST-%s"
%
new_id
,
ssl_certificate
=
"foo"
,
ssl_key
=
"bar"
,
prede
cessor_value
=
instance2
,
suc
cessor_value
=
instance2
,
)
self
.
tic
()
...
...
@@ -2967,7 +2967,7 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
Base
.
reindexObject_call
=
Base
.
_reindexObject
Base
.
_reindexObject
=
verify_reindexObject_call
try
:
instance1
.
edit
(
prede
cessor_value
=
instance3
)
instance1
.
edit
(
suc
cessor_value
=
instance3
)
self
.
tic
()
finally
:
Base
.
_reindexObject
=
Base
.
reindexObject_call
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/scripts/RequestedInstance_bangResquesterInstance.py
View file @
b7d5041e
...
...
@@ -3,7 +3,7 @@ portal = instance.getPortalObject()
for
requester_instance
in
portal
.
portal_catalog
(
portal_type
=
"Software Instance"
,
default_
prede
cessor_uid
=
instance
.
getUid
()):
default_
suc
cessor_uid
=
instance
.
getUid
()):
requester_instance
.
getObject
().
bang
(
bang_tree
=
False
,
comment
=
"%s parameters changed"
%
instance
.
getRelativeUrl
())
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/scripts/RequesterInstance_request.py
View file @
b7d5041e
...
...
@@ -36,17 +36,17 @@ if (portal.portal_activities.countMessageWithTag(tag) > 0):
# graph allows to "simulate" tree change after requested operation
graph
=
{}
predecessor_list
=
hosting_subscription
.
getPrede
cessorValueList
()
graph
[
hosting_subscription
.
getUid
()]
=
[
predecessor
.
getUid
()
for
predecessor
in
prede
cessor_list
]
successor_list
=
hosting_subscription
.
getSuc
cessorValueList
()
graph
[
hosting_subscription
.
getUid
()]
=
[
successor
.
getUid
()
for
successor
in
suc
cessor_list
]
while
True
:
try
:
current_software_instance
=
prede
cessor_list
.
pop
(
0
)
current_software_instance
=
suc
cessor_list
.
pop
(
0
)
except
IndexError
:
break
current_software_instance_
predecessor_list
=
current_software_instance
.
getPrede
cessorValueList
()
or
[]
graph
[
current_software_instance
.
getUid
()]
=
[
prede
cessor
.
getUid
()
for
predecessor
in
current_software_instance_prede
cessor_list
]
predecessor_list
.
extend
(
current_software_instance_prede
cessor_list
)
current_software_instance_
successor_list
=
current_software_instance
.
getSuc
cessorValueList
()
or
[]
graph
[
current_software_instance
.
getUid
()]
=
[
suc
cessor
.
getUid
()
for
successor
in
current_software_instance_suc
cessor_list
]
successor_list
.
extend
(
current_software_instance_suc
cessor_list
)
# Check if it already exists
request_software_instance_list
=
portal
.
portal_catalog
(
...
...
@@ -110,24 +110,24 @@ if (request_software_instance is None):
else
:
instance_found
=
True
# Update the
prede
cessor category of the previous requester
predecessor
=
request_software_instance
.
getPrede
cessorRelatedValue
(
portal_type
=
"Software Instance"
)
if
(
prede
cessor
is
None
):
# Update the
suc
cessor category of the previous requester
successor
=
request_software_instance
.
getSuc
cessorRelatedValue
(
portal_type
=
"Software Instance"
)
if
(
suc
cessor
is
None
):
# Check if the precessor is a Hosting Subscription
hosting_subscription_precessesor
=
request_software_instance
.
get
Prede
cessorRelatedValue
(
portal_type
=
"Hosting Subscription"
)
hosting_subscription_precessesor
=
request_software_instance
.
get
Suc
cessorRelatedValue
(
portal_type
=
"Hosting Subscription"
)
if
(
requester_instance
.
getPortalType
()
!=
"Hosting Subscription"
and
hosting_subscription_precessesor
is
not
None
):
raise
ValueError
(
'It is disallowed to request root software instance %s'
%
request_software_instance
.
getRelativeUrl
())
else
:
prede
cessor
=
requester_instance
suc
cessor
=
requester_instance
# It was a loose node, so check if it ok:
if
request_software_instance
.
getUid
()
not
in
graph
:
graph
[
request_software_instance
.
getUid
()]
=
request_software_instance
.
get
Prede
cessorUidList
()
graph
[
request_software_instance
.
getUid
()]
=
request_software_instance
.
get
Suc
cessorUidList
()
predecessor_uid_list
=
predecessor
.
getPrede
cessorUidList
()
if
request_software_instance
.
getUid
()
in
prede
cessor_uid_list
:
prede
cessor_uid_list
.
remove
(
request_software_instance
.
getUid
())
predecessor
.
edit
(
predecessor_uid_list
=
prede
cessor_uid_list
)
graph
[
predecessor
.
getUid
()]
=
prede
cessor_uid_list
successor_uid_list
=
successor
.
getSuc
cessorUidList
()
if
request_software_instance
.
getUid
()
in
suc
cessor_uid_list
:
suc
cessor_uid_list
.
remove
(
request_software_instance
.
getUid
())
successor
.
edit
(
successor_uid_list
=
suc
cessor_uid_list
)
graph
[
successor
.
getUid
()]
=
suc
cessor_uid_list
if
instance_found
:
...
...
@@ -151,21 +151,21 @@ if instance_found:
else
:
raise
ValueError
,
"state should be started, stopped or destroyed"
predecessor_list
=
requester_instance
.
getPrede
cessorList
()
+
[
request_software_instance_url
]
uniq_
predecessor_list
=
list
(
set
(
prede
cessor_list
))
prede
cessor_list
.
sort
()
uniq_
prede
cessor_list
.
sort
()
successor_list
=
requester_instance
.
getSuc
cessorList
()
+
[
request_software_instance_url
]
uniq_
successor_list
=
list
(
set
(
suc
cessor_list
))
suc
cessor_list
.
sort
()
uniq_
suc
cessor_list
.
sort
()
assert
predecessor_list
==
uniq_predecessor_list
,
"%s != %s"
%
(
predecessor_list
,
uniq_prede
cessor_list
)
assert
successor_list
==
uniq_successor_list
,
"%s != %s"
%
(
successor_list
,
uniq_suc
cessor_list
)
# update graph to reflect requested operation
graph
[
requester_instance
.
getUid
()]
=
requester_instance
.
get
Prede
cessorUidList
()
+
[
request_software_instance
.
getUid
()]
graph
[
requester_instance
.
getUid
()]
=
requester_instance
.
get
Suc
cessorUidList
()
+
[
request_software_instance
.
getUid
()]
# check if all elements are still connected and if there is no cycle
request_software_instance
.
checkConnected
(
graph
,
hosting_subscription
.
getUid
())
request_software_instance
.
checkNotCyclic
(
graph
)
requester_instance
.
edit
(
predecessor_list
=
prede
cessor_list
)
requester_instance
.
edit
(
successor_list
=
suc
cessor_list
)
else
:
context
.
REQUEST
.
set
(
'request_instance'
,
None
)
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/interactions/SoftwareInstance_set
Prede
cessorList.xml
→
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/interactions/SoftwareInstance_set
Suc
cessorList.xml
View file @
b7d5041e
...
...
@@ -28,7 +28,7 @@
<key>
<string>
after_script_name
</string>
</key>
<value>
<list>
<string>
SoftwareInstance_reindexRecursively
Prede
cessorSoftwareInstanceList
</string>
<string>
SoftwareInstance_reindexRecursively
Suc
cessorSoftwareInstanceList
</string>
</list>
</value>
</item>
...
...
@@ -52,13 +52,13 @@ It will create duplicate activities, but only one for each will be fired.</strin
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SoftwareInstance_set
Prede
cessorList
</string>
</value>
<value>
<string>
SoftwareInstance_set
Suc
cessorList
</string>
</value>
</item>
<item>
<key>
<string>
method_id
</string>
</key>
<value>
<list>
<string>
_set
Prede
cessor.*
</string>
<string>
_set
Suc
cessor.*
</string>
</list>
</value>
</item>
...
...
@@ -78,7 +78,7 @@ It will create duplicate activities, but only one for each will be fired.</strin
<key>
<string>
script_name
</string>
</key>
<value>
<list>
<string>
SoftwareInstance_reindexRecursively
Prede
cessorSoftwareInstanceList
</string>
<string>
SoftwareInstance_reindexRecursively
Suc
cessorSoftwareInstanceList
</string>
</list>
</value>
</item>
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/scripts/SoftwareInstance_reindexRecursively
Prede
cessorSoftwareInstanceList.py
→
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/scripts/SoftwareInstance_reindexRecursively
Suc
cessorSoftwareInstanceList.py
View file @
b7d5041e
def
reindexRecursively
(
document
,
after_tag
=
None
):
tag
=
document
.
getPath
()
+
'_reindex'
document
.
activate
(
after_tag
=
after_tag
).
reindexObject
(
activate_kw
=
dict
(
tag
=
tag
))
for
subdocument
in
document
.
get
Prede
cessorValueList
(
portal_type
=
'Software Instance'
):
for
subdocument
in
document
.
get
Suc
cessorValueList
(
portal_type
=
'Software Instance'
):
if
subdocument
.
getValidationState
()
!=
'invalidated'
:
reindexRecursively
(
subdocument
,
tag
)
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/scripts/SoftwareInstance_reindexRecursively
Prede
cessorSoftwareInstanceList.xml
→
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/slapos_cloud_interaction_workflow/scripts/SoftwareInstance_reindexRecursively
Suc
cessorSoftwareInstanceList.xml
View file @
b7d5041e
...
...
@@ -54,7 +54,7 @@
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
SoftwareInstance_reindexRecursively
Prede
cessorSoftwareInstanceList
</string>
</value>
<value>
<string>
SoftwareInstance_reindexRecursively
Suc
cessorSoftwareInstanceList
</string>
</value>
</item>
</dictionary>
</pickle>
...
...
master/bt5/slapos_cloud/bt/template_catalog_method_id_list
View file @
b7d5041e
...
...
@@ -19,4 +19,4 @@ erp5_mysql_innodb/z_create_software_instance_tree
erp5_mysql_innodb/z_create_versioning
erp5_mysql_innodb/z_related_causality_subscription_request
erp5_mysql_innodb/z_related_default_or_child_aggregate
erp5_mysql_innodb/z_related_predecessor_but_with_different_title_than_catalog_title
\ No newline at end of file
erp5_mysql_innodb/z_related_successor_but_with_different_title_than_catalog_title
\ No newline at end of file
master/bt5/slapos_cloud/bt/template_catalog_related_key_list
View file @
b7d5041e
causality_subscription_request_related_uid | category,catalog/uid/z_related_causality_subscription_request
related_
predecessor_but_with_different_title_than_catalog_title | category,catalog/uid/z_related_prede
cessor_but_with_different_title_than_catalog_title
related_
successor_but_with_different_title_than_catalog_title | category,catalog/uid/z_related_suc
cessor_but_with_different_title_than_catalog_title
default_or_child_aggregate_reference | catalog,category,catalog/reference/z_related_default_or_child_aggregate
default_or_child_aggregate_uid | catalog,category,catalog/uid/z_related_default_or_child_aggregate
\ No newline at end of file
master/bt5/slapos_cloud/bt/template_path_list
View file @
b7d5041e
...
...
@@ -9,7 +9,7 @@ hosting_subscription_module/template_hosting_subscription
person_module/template_member
person_module/template_member/**
portal_alarms/slapos_allocate_instance
portal_alarms/slapos_assert_hosting_subscription_
prede
cessor
portal_alarms/slapos_assert_hosting_subscription_
suc
cessor
portal_alarms/slapos_cloud_invalidate_destroyed_instance
portal_alarms/slapos_free_computer_partition
portal_alarms/slapos_garbage_collect_destroy_unlinked_instance
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequestModule_getMonitoringUrlList.py
View file @
b7d5041e
...
...
@@ -22,7 +22,7 @@ for hosting_subscription in hosting_subscription_list:
if
hosting_subscription
.
getSlapState
()
==
'destroy_requested'
:
continue
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
if
instance
is
None
or
instance
.
getSlapState
()
in
(
'destroy_requested'
,
'stop_requested'
):
continue
...
...
master/bt5/slapos_crm/SkinTemplateItem/portal_skins/slapos_crm_monitoring/SupportRequest_getInstanceMonitorUrl.py
View file @
b7d5041e
...
...
@@ -5,7 +5,7 @@ if hosting_subscription is None:
return
instance
=
None
for
possible_instance
in
hosting_subscription
.
get
Prede
cessorValueList
():
for
possible_instance
in
hosting_subscription
.
get
Suc
cessorValueList
():
if
possible_instance
.
getSlapState
()
!=
'destroy_requested'
:
instance
=
possible_instance
break
...
...
master/bt5/slapos_crm/TestTemplateItem/portal_components/test.erp5.testSlapOSCRMSkins.py
View file @
b7d5041e
...
...
@@ -116,12 +116,12 @@ class TestSlapOSSupportRequestModule_getMonitoringUrlList(TestCRMSkinsMixin):
self
.
assertEqual
(
module
.
SupportRequestModule_getMonitoringUrlList
(),
[])
support_request
.
setAggregateValue
(
hosting_subscription
)
support_request
.
validate
()
self
.
assertNotEqual
(
hosting_subscription
.
get
Prede
cessorList
(),
[])
self
.
assertNotEqual
(
hosting_subscription
.
get
Suc
cessorList
(),
[])
self
.
tic
()
self
.
assertEqual
(
module
.
SupportRequestModule_getMonitoringUrlList
(),
[])
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
instance
.
setConnectionXml
(
"""<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id="aa">xx</parameter>
...
...
@@ -153,7 +153,7 @@ class TestSlapOSSupportRequestModule_getMonitoringUrlList(TestCRMSkinsMixin):
"http://monitor.url/#/ABC"
)
support_request
.
invalidate
()
self
.
tic
()
self
.
assertNotEqual
(
hosting_subscription
.
get
Prede
cessorList
(),
[])
self
.
assertNotEqual
(
hosting_subscription
.
get
Suc
cessorList
(),
[])
class
TestSlapOSFolder_getOpenTicketList
(
TestCRMSkinsMixin
):
...
...
@@ -1025,7 +1025,7 @@ class TestSlapOSGenerateSupportRequestForSlapOS(TestCRMSkinsMixin):
self
.
_makeSoftwareInstance
(
hosting_subscription
,
self
.
generateNewSoftwareReleaseUrl
())
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
title
=
"Test Support Request %s"
%
instance
.
getReference
()
support_request
=
instance
.
Base_generateSupportRequestForSlapOS
(
title
,
title
,
instance
.
getRelativeUrl
()
...
...
@@ -1517,7 +1517,7 @@ class TestSlapOSHasError(SlapOSTestCaseMixin):
hosting_subscription
=
self
.
_makeHostingSubscription
()
self
.
_makeSoftwareInstance
(
hosting_subscription
,
self
.
generateNewSoftwareReleaseUrl
())
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
_makeComputer
()
self
.
_makeComputerPartitionList
()
...
...
@@ -1590,7 +1590,7 @@ class TestSlapOSHasError(SlapOSTestCaseMixin):
self
.
_makeSoftwareInstance
(
hosting_subscription
,
self
.
generateNewSoftwareReleaseUrl
())
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
assertEqual
(
instance
.
getCreationDate
(),
date
-
2
)
...
...
@@ -1649,7 +1649,7 @@ class TestSlapOSHasError(SlapOSTestCaseMixin):
self
.
_makeSoftwareInstance
(
hosting_subscription
,
self
.
generateNewSoftwareReleaseUrl
())
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
assertEqual
(
instance
.
getCreationDate
(),
date
-
2
)
...
...
@@ -1698,7 +1698,7 @@ class TestSlapOSHasError(SlapOSTestCaseMixin):
self
.
_makeSoftwareInstance
(
hosting_subscription
,
self
.
generateNewSoftwareReleaseUrl
())
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
assertEqual
(
instance
.
getCreationDate
(),
date
-
2
)
...
...
@@ -1728,7 +1728,7 @@ class TestSlapOSHasError(SlapOSTestCaseMixin):
self
.
assertEqual
(
'Visited by HostingSubscription_createSupportRequestEvent %s %s'
%
\
(
instance
.
get
Prede
cessor
(
portal_type
=
"Software Instance"
),
(
instance
.
get
Suc
cessor
(
portal_type
=
"Software Instance"
),
"slapos-crm-hosting-subscription-instance-allocation.notification"
),
hosting_subscription
.
HostingSubscription_checkSoftwareInstanceState
())
...
...
@@ -1752,7 +1752,7 @@ class TestSlapOSHasError(SlapOSTestCaseMixin):
self
.
_makeSoftwareInstance
(
hosting_subscription
,
self
.
generateNewSoftwareReleaseUrl
())
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
_makeComputer
()
...
...
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/expected_alarm_tool_dumped_configuration.txt
View file @
b7d5041e
...
...
@@ -20,7 +20,7 @@ portal_alarms/open_bugs_alarm;0;None;BugModule_sendOpenBugListReminder;None;None
portal_alarms/promise_check_upgrade;0;None;Alarm_runFullUpgrader;None;None;None;();None;();None;();();None;2013/11/14 10:00:00 GMT;None;();None;None
portal_alarms/slapos_accounting_generate_packing_list_from_tioxml;1;None;Alarm_searchSubmittedConsumptionTioXMLFileList;None;None;1;(4,);None;(0,);None;();();None;1970/01/01 00:00:00 GMT;None;();None;None
portal_alarms/slapos_allocate_instance;1;None;Alarm_allocateInstance;None;None;None;();None;();1;();();None;2010/10/26 00:00:00 GMT;None;();None;None
portal_alarms/slapos_assert_hosting_subscription_
predecessor;1;None;Alarm_assertHostingSubscriptionHasPrede
cessor;None;None;None;();None;();1;();();None;1980/01/01 00:00:00 GMT;None;();None;None
portal_alarms/slapos_assert_hosting_subscription_
successor;1;None;Alarm_assertHostingSubscriptionHasSuc
cessor;None;None;None;();None;();1;();();None;1980/01/01 00:00:00 GMT;None;();None;None
portal_alarms/slapos_check_duplicated_software_instance;0;None;Alarm_searchDuplicatedSoftwareInstance;None;None;None;None;None;None;None;None;None;None;1983/10/01 00:00:00 GMT;None;None;None;None
portal_alarms/slapos_check_security_uid;0;None;Alarm_checkUnindexedSecurityUid;None;None;None;None;None;None;None;None;None;None;1983/10/01 00:00:00 GMT;None;None;None;None
portal_alarms/slapos_cloud_invalidate_destroyed_instance;1;None;Alarm_invalidateDestroyedInstance;None;None;None;();1;();None;();();None;2010/10/26 00:00:00 GMT;None;();None;None
...
...
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/expected_portal_skins_dumped_configuration.txt
View file @
b7d5041e
...
...
@@ -3740,7 +3740,7 @@ slapos_base;Login_unrestrictedSearchAuthenticationEvent;External Method;d41d8cd9
slapos_base;Login_unrestrictedSearchPasswordEvent;External Method;d41d8cd98f00b204e9800998ecf8427e
slapos_base;Person_generatePassword;Script (Python);c7ef6238cae53aa95b033073585f0901
slapos_cloud;Alarm_allocateInstance;Script (Python);acc96d48f45c96906bc0d8534ed3dea6
slapos_cloud;Alarm_assertHostingSubscriptionHas
Prede
cessor;Script (Python);7c0335b05dbeaae5da24936c7822cd08
slapos_cloud;Alarm_assertHostingSubscriptionHas
Suc
cessor;Script (Python);7c0335b05dbeaae5da24936c7822cd08
slapos_cloud;Alarm_garbageCollectDestroyUnlinkedInstance;Script (Python);a9fa5bcdfbbc9d2e97a53c31082b8d54
slapos_cloud;Alarm_garbageCollectDestroyedRootTree;Script (Python);c7693ceb6f665d589769e75f76bba13a
slapos_cloud;Alarm_garbageCollectNonAllocatedRootTree;Script (Python);f4cac8eb737a55987061cbcc5d4bed5a
...
...
@@ -3794,7 +3794,7 @@ slapos_cloud;Computer_viewCurrentUsage;ERP5 Form;567bc1d268f135496de3d5b946b691f
slapos_cloud;Computer_viewModel;ERP5 Form;567bc1d268f135496de3d5b946b691f3
slapos_cloud;ERP5Type_asSecurityGroupId;Script (Python);6abe5e755c936d813d93ca1fcd441580
slapos_cloud;HostingSubscriptionModule_viewHostingSubscriptionList;ERP5 Form;567bc1d268f135496de3d5b946b691f3
slapos_cloud;HostingSubscription_assert
Prede
cessor;Script (Python);b5ff47cbf59b6b48746890b0753e7606
slapos_cloud;HostingSubscription_assert
Suc
cessor;Script (Python);b5ff47cbf59b6b48746890b0753e7606
slapos_cloud;HostingSubscription_createMovement;Script (Python);c2f26b34c511ea84c1bb6cb6cbf4f06d
slapos_cloud;HostingSubscription_requestDestroy;Script (Python);8e98fdfd518b1de8dcbb3a5d0ba37e5a
slapos_cloud;HostingSubscription_requestPerson;Script (Python);0f307b89333e4376e21ba85e600372d0
...
...
@@ -3854,7 +3854,7 @@ slapos_cloud_interaction_workflow;Instance_invalidate;Script (Python);fcaf874d03
slapos_cloud_interaction_workflow;Instance_triggerAllocationAlarm;Script (Python);613d655f8c33a46c141848330a6fa24c
slapos_cloud_interaction_workflow;SoftwareInstallation_reindexComputer;Script (Python);85f2179687f313a0ca70f2be62064bbc
slapos_cloud_interaction_workflow;SoftwareInstance_reindexComputerPartition;Script (Python);5189f54f1d3e70956ef2d573c13b8a3f
slapos_cloud_interaction_workflow;SoftwareInstance_reindexRecursively
Prede
cessorSoftwareInstanceList;Script (Python);cb79894e2b06592e4f15092182f63830
slapos_cloud_interaction_workflow;SoftwareInstance_reindexRecursively
Suc
cessorSoftwareInstanceList;Script (Python);cb79894e2b06592e4f15092182f63830
slapos_configurator;BusinessConfiguration_invokeSlapOSMasterPromiseAlarmList;Script (Python);26e275695886835b1c8957aa23da5b7c
slapos_configurator;BusinessConfiguration_setupSlapOSMasterStandardBT5;Script (Python);be0a52a246011ea6a23811640b864cbe
slapos_configurator;TemplateTool_getSlapOSMasterBusinessTemplateList;Script (Python);620fc8300f61b25e30507b4f2eb18f39
...
...
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/expected_property_sheet_dumped_configuration.txt
View file @
b7d5041e
...
...
@@ -16771,12 +16771,12 @@ SlaveInstanceConstraint
reference: non_draft_property_existence
SlaveInstanceConstraint
expression: python: len(context.get
Prede
cessorRelatedList()) <= 1
id:
prede
cessor_related_constraint
expression: python: len(context.get
Suc
cessorRelatedList()) <= 1
id:
suc
cessor_related_constraint
message_expression_error: Error while evaluating expression: ${error}
message_expression_false: There is more then one related
prede
cessor
message_expression_false: There is more then one related
suc
cessor
portal_type: TALES Constraint
reference:
prede
cessor_related
reference:
suc
cessor_related
SlaveInstanceConstraint
constraint_property_list: ['reference']
...
...
@@ -16817,9 +16817,9 @@ SoftwareInstance
write_permission: Modify portal content
SoftwareInstance
id:
prede
cessor_category
id:
suc
cessor_category
portal_type: Category Property
reference:
prede
cessor
reference:
suc
cessor
SoftwareInstance
elementary_type: text
...
...
@@ -16889,12 +16889,12 @@ SoftwareInstanceConstraint
reference: not_draft_propert_existence
SoftwareInstanceConstraint
expression: python: len(context.get
Prede
cessorRelatedList()) <= 1
id:
prede
cessor_related_constraint
expression: python: len(context.get
Suc
cessorRelatedList()) <= 1
id:
suc
cessor_related_constraint
message_expression_error: Error while evaluating expression: ${error}
message_expression_false: There is more then one related
prede
cessor
message_expression_false: There is more then one related
suc
cessor
portal_type: TALES Constraint
reference:
prede
cessor_related
reference:
suc
cessor_related
SoftwareInstanceConstraint
constraint_property_list: ['destination_reference', 'reference']
...
...
master/bt5/slapos_erp5/SkinTemplateItem/portal_skins/slapos_administration/expected_type_actions_dumped_configuration.txt
View file @
b7d5041e
...
...
@@ -13741,7 +13741,7 @@ Slave Instance
Slave Instance
Reference: jump_to_software_instance
Title: Software Instance
Action: string:${object_url}/Base_jumpToRelatedObject?base_category=
prede
cessor&portal_type=Software+Instance
Action: string:${object_url}/Base_jumpToRelatedObject?base_category=
suc
cessor&portal_type=Software+Instance
Icon: None
Permission: View
Action Type: object_jump
...
...
@@ -13841,7 +13841,7 @@ Software Instance
Software Instance
Reference: jump_to_software_instance
Title: Requester Instance
Action: string:${object_url}/Base_jumpToRelatedObject?base_category=
prede
cessor&portal_type:list=Software+Instance&portal_type:list=Hosting+Subscription
Action: string:${object_url}/Base_jumpToRelatedObject?base_category=
suc
cessor&portal_type:list=Software+Instance&portal_type:list=Hosting+Subscription
Icon: None
Permission: View
Action Type: object_jump
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/HostingSubscription_getConnectionParameterList.py
View file @
b7d5041e
title
=
context
.
getTitle
()
result
=
[]
found
=
False
for
instance
in
context
.
get
Prede
cessorValueList
():
for
instance
in
context
.
get
Suc
cessorValueList
():
if
(
instance
.
getTitle
()
==
title
)
and
(
instance
.
getSlapState
()
!=
'destroy_requested'
):
found
=
True
break
...
...
master/bt5/slapos_jio/SkinTemplateItem/portal_skins/slapos_hal_json_style/HostingSubscription_getMonitorParameterDict.py
View file @
b7d5041e
...
...
@@ -21,7 +21,7 @@ hosting_subscription = context
if
hosting_subscription
.
getSlapState
()
==
'destroy_requested'
:
return
json
.
dumps
({})
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
if
instance
is
None
or
instance
.
getSlapState
()
==
'destroy_requested'
:
return
json
.
dumps
({})
...
...
master/bt5/slapos_jio_hateoas_backward_compatibility/SkinTemplateItem/portal_skins/slapos_hal_json_style_backward_compatibility/HostingSubscription_getHateoasRootSoftwareInstance.py
View file @
b7d5041e
...
...
@@ -16,7 +16,7 @@ elif context.getPortalType() != "Hosting Subscription":
response
.
setStatus
(
403
)
return
""
instance_list
=
context
.
get
Prede
cessorValueList
()
instance_list
=
context
.
get
Suc
cessorValueList
()
for
instance
in
instance_list
:
if
instance
.
getTitle
()
==
context
.
getTitle
():
root_instance
=
instance
...
...
master/bt5/slapos_jio_hateoas_backward_compatibility/TestTemplateItem/portal_components/test.erp5.testSlapOSHypermediaSkins.py
View file @
b7d5041e
...
...
@@ -462,7 +462,7 @@ class TestSlapOSHostingSubscription_getHateoasRootSoftwareInstance(TestSlapOSHyp
subscription
=
self
.
_makeHostingSubscription
()
instance
=
self
.
_makeInstance
()
instance
.
edit
(
specialise_value
=
subscription
,
title
=
subscription
.
getTitle
())
subscription
.
edit
(
prede
cessor_value
=
instance
)
subscription
.
edit
(
suc
cessor_value
=
instance
)
self
.
tic
()
fake_request
=
do_fake_request
(
"GET"
)
...
...
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/HostingSubscription_createUpgradeDecision.py
View file @
b7d5041e
...
...
@@ -7,7 +7,7 @@ if upgrade_scope in ["never", "disabled"]:
return
root_instance_list
=
[
q
for
q
in
hosting_subscription
.
get
Prede
cessorValueList
(
portal_type
=
[
"Software Instance"
,
"Slave Instance"
])
q
for
q
in
hosting_subscription
.
get
Suc
cessorValueList
(
portal_type
=
[
"Software Instance"
,
"Slave Instance"
])
if
q
.
getSlapState
()
!=
'destroy_requested'
]
if
len
(
root_instance_list
)
==
0
:
return
...
...
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/HostingSubscription_getNewerSofwareRelease.py
View file @
b7d5041e
hosting_subscription
=
context
software_instance
=
hosting_subscription
.
get
Prede
cessorValue
()
software_instance
=
hosting_subscription
.
get
Suc
cessorValue
()
if
not
software_instance
:
return
None
software_release_list
=
context
.
SoftwareProduct_getSortedSoftwareReleaseList
(
...
...
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/HostingSubscription_getUpgradableSoftwareRelease.py
View file @
b7d5041e
...
...
@@ -11,7 +11,7 @@ slap_state = ['start_requested', 'stop_requested']
if
not
hosting_subscription
.
getSlapState
()
in
slap_state
:
return
None
source_instance_list
=
[
q
for
q
in
hosting_subscription
.
get
Prede
cessorValueList
()
if
q
.
getSlapState
()
in
slap_state
]
source_instance_list
=
[
q
for
q
in
hosting_subscription
.
get
Suc
cessorValueList
()
if
q
.
getSlapState
()
in
slap_state
]
if
len
(
source_instance_list
)
==
0
:
return
None
source_instance
=
source_instance_list
[
0
]
...
...
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/HostingSubscription_isUpgradePossible.py
View file @
b7d5041e
portal
=
context
.
getPortalObject
()
# This won't work well on clusters deployed on multiple computers.
root_instance
=
context
.
get
Prede
cessorValue
(
root_instance
=
context
.
get
Suc
cessorValue
(
portal_type
=
[
"Software Instance"
,
"Slave Instance"
])
if
root_instance
is
not
None
and
root_instance
.
getPortalType
()
==
'Slave Instance'
:
return
True
...
...
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins.py
View file @
b7d5041e
...
...
@@ -80,7 +80,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
hosting_subscription
.
requestStart
(
**
request_kw
)
hosting_subscription
.
requestInstance
(
**
request_kw
)
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
tic
()
return
hosting_subscription
,
instance
...
...
@@ -185,7 +185,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
self
.
_makeFullSoftwareInstance
(
hosting_subscription
,
url_string
)
self
.
_markComputerPartitionBusy
(
computer
,
hosting_subscription
.
get
Prede
cessorValue
())
hosting_subscription
.
get
Suc
cessorValue
())
self
.
_requestSoftwareRelease
(
software_product
.
getRelativeUrl
())
self
.
tic
()
...
...
@@ -209,7 +209,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
url_string
,
person
)
self
.
_makeFullSoftwareInstance
(
hosting_subscription
,
url_string
)
self
.
_markComputerPartitionBusy
(
computer
,
hosting_subscription
.
get
Prede
cessorValue
())
hosting_subscription
.
get
Suc
cessorValue
())
# Install the Newest software release
software_release2
=
self
.
_requestSoftwareRelease
(
...
...
@@ -237,7 +237,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
url_string
,
person
)
self
.
_makeFullSoftwareInstance
(
hosting_subscription
,
url_string
)
self
.
_markComputerPartitionBusy
(
computer
,
hosting_subscription
.
get
Prede
cessorValue
())
hosting_subscription
.
get
Suc
cessorValue
())
# Install the Newest software release
software_release2
=
self
.
_requestSoftwareRelease
(
...
...
@@ -271,7 +271,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
url_string
,
person
)
self
.
_makeFullSoftwareInstance
(
hosting_subscription
,
url_string
)
self
.
_markComputerPartitionBusy
(
computer
,
hosting_subscription
.
get
Prede
cessorValue
())
hosting_subscription
.
get
Suc
cessorValue
())
# Install the Newest software release
software_release2
=
self
.
_requestSoftwareRelease
(
...
...
@@ -311,7 +311,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
url_string
,
person
)
self
.
_makeFullSoftwareInstance
(
hosting_subscription
,
url_string
)
self
.
_markComputerPartitionBusy
(
computer
,
hosting_subscription
.
get
Prede
cessorValue
())
hosting_subscription
.
get
Suc
cessorValue
())
# Install the Newest software release
software_release2
=
self
.
_requestSoftwareRelease
(
...
...
@@ -351,7 +351,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
url_string
,
person
)
self
.
_makeFullSoftwareInstance
(
hosting_subscription
,
url_string
)
self
.
_markComputerPartitionBusy
(
computer
,
hosting_subscription
.
get
Prede
cessorValue
())
hosting_subscription
.
get
Suc
cessorValue
())
# Install the Newest software release
software_release2
=
self
.
_requestSoftwareRelease
(
...
...
@@ -390,7 +390,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
url_string
,
person
)
self
.
_makeFullSoftwareInstance
(
hosting_subscription
,
url_string
)
self
.
_markComputerPartitionBusy
(
computer
,
hosting_subscription
.
get
Prede
cessorValue
())
hosting_subscription
.
get
Suc
cessorValue
())
# Install the Newest software release
software_release2
=
self
.
_requestSoftwareRelease
(
...
...
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMDestroySoftwareInstallationWithArchivedSoftwareReleaseAlarm.py
View file @
b7d5041e
...
...
@@ -45,7 +45,7 @@ class TestSlapOSDestroySoftwareInstallationWithArchivedSoftwareReleaseAlarm(Slap
hosting_subscription
.
requestStart
(
**
request_kw
)
hosting_subscription
.
requestInstance
(
**
request_kw
)
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
tic
()
return
instance
...
...
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
View file @
b7d5041e
...
...
@@ -156,7 +156,7 @@ class TestSlapOSPDMMixinSkins(SlapOSTestCaseMixin):
specialise
=
hosting_subscription
.
getRelativeUrl
()
)
hosting_subscription
.
edit
(
prede
cessor
=
software_instance
.
getRelativeUrl
()
suc
cessor
=
software_instance
.
getRelativeUrl
()
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
software_instance
,
'start_requested'
)
software_instance
.
validate
()
...
...
@@ -291,7 +291,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
None
)
self
.
_makeFullSoftwareInstance
(
hs
,
oldest_software_url
)
self
.
_markComputerPartitionBusy
(
computer
,
hs
.
get
Prede
cessorValue
())
self
.
_markComputerPartitionBusy
(
computer
,
hs
.
get
Suc
cessorValue
())
self
.
_makeCustomSoftwareRelease
(
software_product
.
getRelativeUrl
(),
newest_software_url
)
self
.
tic
()
...
...
@@ -313,7 +313,7 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
oldest_software_url
,
person
)
self
.
_makeFullSoftwareInstance
(
hs
,
oldest_software_url
)
self
.
_markComputerPartitionBusy
(
computer
,
hs
.
get
Prede
cessorValue
())
self
.
_markComputerPartitionBusy
(
computer
,
hs
.
get
Suc
cessorValue
())
self
.
_makeCustomSoftwareRelease
(
software_product
.
getRelativeUrl
(),
newest_software_url
)
self
.
_makeSoftwareInstallation
(
computer
,
...
...
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
View file @
b7d5041e
...
...
@@ -2064,7 +2064,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
if
os
.
path
.
exists
(
self
.
instance_request_simulator
):
os
.
unlink
(
self
.
instance_request_simulator
)
def
test_updateInstance
Prede
cessorList
(
self
):
def
test_updateInstance
Suc
cessorList
(
self
):
self
.
_makeComplexComputer
()
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
...
...
@@ -2086,9 +2086,9 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
self
.
start_requested_software_instance
.
requestInstance
(
**
instance_kw
)
self
.
tic
()
self
.
assertEqual
(
len
(
self
.
start_requested_software_instance
.
get
Prede
cessorList
()),
2
)
self
.
assertEqual
(
len
(
self
.
start_requested_software_instance
.
get
Suc
cessorList
()),
2
)
self
.
assertSameSet
([
'Instance0'
,
'Instance1'
],
self
.
start_requested_software_instance
.
get
Prede
cessorTitleList
())
self
.
start_requested_software_instance
.
get
Suc
cessorTitleList
())
# Update with no changes
instance_list_xml
=
"""
...
...
@@ -2101,7 +2101,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
instance_reference_xml
=
instance_list_xml
)
self
.
tic
()
self
.
assertSameSet
([
'Instance0'
,
'Instance1'
],
self
.
start_requested_software_instance
.
get
Prede
cessorTitleList
())
self
.
start_requested_software_instance
.
get
Suc
cessorTitleList
())
# Update Instance0 was not requested
instance_list_xml
=
"""
...
...
@@ -2114,9 +2114,9 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
instance_reference_xml
=
instance_list_xml
)
self
.
tic
()
self
.
assertSameSet
([
'Instance1'
],
self
.
start_requested_software_instance
.
get
Prede
cessorTitleList
())
self
.
start_requested_software_instance
.
get
Suc
cessorTitleList
())
def
test_updateInstance
Prede
cessorList_one_child
(
self
):
def
test_updateInstance
Suc
cessorList_one_child
(
self
):
self
.
_makeComplexComputer
()
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
...
...
@@ -2136,9 +2136,9 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
self
.
start_requested_software_instance
.
requestInstance
(
**
instance_kw
)
self
.
tic
()
self
.
assertEqual
(
len
(
self
.
start_requested_software_instance
.
get
Prede
cessorList
()),
1
)
self
.
assertEqual
(
len
(
self
.
start_requested_software_instance
.
get
Suc
cessorList
()),
1
)
self
.
assertSameSet
([
'Instance0'
],
self
.
start_requested_software_instance
.
get
Prede
cessorTitleList
())
self
.
start_requested_software_instance
.
get
Suc
cessorTitleList
())
instance_list_xml
=
'<marshal><list id="i2" /></marshal>'
self
.
portal_slap
.
updateComputerPartitionRelatedInstanceList
(
...
...
@@ -2147,9 +2147,9 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
instance_reference_xml
=
instance_list_xml
)
self
.
tic
()
self
.
assertEqual
([],
self
.
start_requested_software_instance
.
get
Prede
cessorTitleList
())
self
.
start_requested_software_instance
.
get
Suc
cessorTitleList
())
def
test_updateInstance
Prede
cessorList_no_child
(
self
):
def
test_updateInstance
Suc
cessorList_no_child
(
self
):
self
.
_makeComplexComputer
()
partition_id
=
self
.
start_requested_software_instance
.
getAggregateValue
(
...
...
@@ -2157,7 +2157,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
self
.
login
(
self
.
start_requested_software_instance
.
getUserId
())
self
.
assertEqual
([],
self
.
start_requested_software_instance
.
get
Prede
cessorTitleList
())
self
.
start_requested_software_instance
.
get
Suc
cessorTitleList
())
instance_list_xml
=
'<marshal><list id="i2" /></marshal>'
self
.
portal_slap
.
updateComputerPartitionRelatedInstanceList
(
...
...
@@ -2166,7 +2166,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
instance_reference_xml
=
instance_list_xml
)
self
.
tic
()
self
.
assertEqual
([],
self
.
start_requested_software_instance
.
get
Prede
cessorTitleList
())
self
.
start_requested_software_instance
.
get
Suc
cessorTitleList
())
# Try with something that doesn't exist
instance_list_xml
=
"""
...
...
@@ -2179,7 +2179,7 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
instance_reference_xml
=
instance_list_xml
)
self
.
tic
()
self
.
assertEqual
([],
self
.
start_requested_software_instance
.
get
Prede
cessorTitleList
())
self
.
start_requested_software_instance
.
get
Suc
cessorTitleList
())
def
test_stoppedComputerPartition
(
self
):
self
.
_makeComplexComputer
()
...
...
master/bt5/slapos_slap_tool/ToolComponentTemplateItem/portal_components/tool.erp5.SlapTool.py
View file @
b7d5041e
...
...
@@ -599,7 +599,7 @@ class SlapTool(BaseTool):
computer_partition_id
,
instance_reference_xml
):
"""
Update Software Instance
prede
cessor list
Update Software Instance
suc
cessor list
"""
return
self
.
_updateComputerPartitionRelatedInstanceList
(
computer_id
,
computer_partition_id
,
...
...
@@ -1430,9 +1430,9 @@ class SlapTool(BaseTool):
def
_updateComputerPartitionRelatedInstanceList
(
self
,
computer_id
,
computer_partition_id
,
instance_reference_xml
):
"""
Update Software Instance
prede
cessor list to match the given list. If one
Update Software Instance
suc
cessor list to match the given list. If one
instance was not requested by this computer partition, it should be removed
in the
prede
cessor_list of this instance.
in the
suc
cessor_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
...
...
@@ -1446,21 +1446,21 @@ class SlapTool(BaseTool):
if
self
.
_getLastData
(
cache_reference
)
!=
instance_reference_xml
:
instance_reference_list
=
loads
(
instance_reference_xml
)
current_
predecessor_list
=
software_instance_document
.
getPrede
cessorValueList
(
current_
successor_list
=
software_instance_document
.
getSuc
cessorValueList
(
portal_type
=
[
'Software Instance'
,
'Slave Instance'
])
current_
prede
cessor_title_list
=
[
i
.
getTitle
()
for
i
in
current_
prede
cessor_list
]
current_
suc
cessor_title_list
=
[
i
.
getTitle
()
for
i
in
current_
suc
cessor_list
]
# If there are items to remove
if
list
(
set
(
current_
prede
cessor_title_list
).
difference
(
instance_reference_list
))
!=
[]:
prede
cessor_list
=
[
instance
.
getRelativeUrl
()
for
instance
in
current_
prede
cessor_list
if
instance
.
getTitle
()
if
list
(
set
(
current_
suc
cessor_title_list
).
difference
(
instance_reference_list
))
!=
[]:
suc
cessor_list
=
[
instance
.
getRelativeUrl
()
for
instance
in
current_
suc
cessor_list
if
instance
.
getTitle
()
in
instance_reference_list
]
LOG
(
'SlapTool'
,
INFO
,
'%s, %s: Updating
prede
cessor list to %s'
%
(
computer_id
,
computer_partition_id
,
prede
cessor_list
),
error
=
False
)
software_instance_document
.
edit
(
predecessor_list
=
prede
cessor_list
,
comment
=
'
prede
cessor_list edited to unlink non commited instances'
)
LOG
(
'SlapTool'
,
INFO
,
'%s, %s: Updating
suc
cessor list to %s'
%
(
computer_id
,
computer_partition_id
,
suc
cessor_list
),
error
=
False
)
software_instance_document
.
edit
(
successor_list
=
suc
cessor_list
,
comment
=
'
suc
cessor_list edited to unlink non commited instances'
)
self
.
_storeLastData
(
cache_reference
,
instance_reference_xml
)
####################################################
...
...
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/SubscriptionRequest_processOrdered.py
View file @
b7d5041e
...
...
@@ -15,7 +15,7 @@ if hosting_subscription is not None:
# Call it as soon as possible
hosting_subscription
.
HostingSubscription_requestUpdateOpenSaleOrder
()
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
# This ensure that the user has a valid cloud contract.
# At this stage he already have a paied invoice for the reservation,
...
...
master/bt5/slapos_subscription_request/SkinTemplateItem/portal_skins/slapos_subscription_request/TrialRequest_processDestroy.py
View file @
b7d5041e
...
...
@@ -41,7 +41,7 @@ person.requestSoftwareInstance(**request_kw)
assert
hosting_subscription
.
getSlapState
()
==
"destroy_requested"
,
\
"Hosting Subscription not destroyed!!"
connection_dict
=
hosting_subscription
.
get
Prede
cessorValue
().
getConnectionXmlAsDict
()
connection_dict
=
hosting_subscription
.
get
Suc
cessorValue
().
getConnectionXmlAsDict
()
connection_key_list
=
context
.
getSubjectList
()
connection_string
=
'
\
n
'
.
join
([
'%s: %s'
%
(
x
,
y
)
for
x
,
y
in
connection_dict
.
items
()
if
x
in
connection_key_list
])
...
...
master/bt5/slapos_subscription_request/TestTemplateItem/portal_components/test.erp5.testSlapOSSubscriptionSkins.py
View file @
b7d5041e
...
...
@@ -1083,12 +1083,12 @@ class TestSubscriptionRequest_processOrdered(TestSubscriptionSkinsMixin):
hosting_subscription
=
subscription_request
.
getAggregateValue
(
portal_type
=
"Hosting Subscription"
)
self
.
assertNotEqual
(
hosting_subscription
,
None
)
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
assertNotEqual
(
instance
,
None
)
self
.
assertEqual
(
'diverged'
,
hosting_subscription
.
getCausalityState
())
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
assertNotEqual
(
instance
,
None
)
...
...
@@ -1166,7 +1166,7 @@ class TestSubscriptionRequest_processOrdered(TestSubscriptionSkinsMixin):
self
.
assertEqual
(
'diverged'
,
hosting_subscription
.
getCausalityState
())
self
.
assertEqual
(
'start_requested'
,
hosting_subscription
.
getSlapState
())
instance
=
hosting_subscription
.
get
Prede
cessorValue
()
instance
=
hosting_subscription
.
get
Suc
cessorValue
()
self
.
assertNotEqual
(
instance
,
None
)
...
...
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