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
Paul Graydon
slapos.core
Commits
4eeac9b7
Commit
4eeac9b7
authored
Jan 14, 2022
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_pdm: Implement upgrade_slap_interface_workflow
parent
60948897
Changes
46
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
46 changed files
with
2069 additions
and
390 deletions
+2069
-390
master/bt5/slapos_pdm/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
...rtalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
+1
-1
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Alarm_cancelUpgradeDecision.py
...em/portal_skins/slapos_pdm/Alarm_cancelUpgradeDecision.py
+0
-2
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/ComputeNode_checkAndCreateUpgradeDecision.py
...s/slapos_pdm/ComputeNode_checkAndCreateUpgradeDecision.py
+7
-11
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/InstanceTree_createUpgradeDecision.py
...al_skins/slapos_pdm/InstanceTree_createUpgradeDecision.py
+8
-13
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecisionLine_cancel.py
...tem/portal_skins/slapos_pdm/UpgradeDecisionLine_cancel.py
+1
-41
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_getAggregateValue.py
...tal_skins/slapos_pdm/UpgradeDecision_getAggregateValue.py
+5
-2
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_getSoftwareRelease.py
...al_skins/slapos_pdm/UpgradeDecision_getSoftwareRelease.py
+0
-13
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_isUpgradeFinished.py
...tal_skins/slapos_pdm/UpgradeDecision_isUpgradeFinished.py
+1
-1
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_notify.py
...ateItem/portal_skins/slapos_pdm/UpgradeDecision_notify.py
+9
-7
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_notifyDelivered.py
...ortal_skins/slapos_pdm/UpgradeDecision_notifyDelivered.py
+5
-3
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_processUpgrade.py
...portal_skins/slapos_pdm/UpgradeDecision_processUpgrade.py
+1
-7
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_processUpgrade.xml
...ortal_skins/slapos_pdm/UpgradeDecision_processUpgrade.xml
+1
-1
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_upgradeComputeNode.py
...al_skins/slapos_pdm/UpgradeDecision_upgradeComputeNode.py
+0
-21
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudUpgradeSlapInterfaceWorkflow.py
.../test.erp5.testSlapOSCloudUpgradeSlapInterfaceWorkflow.py
+557
-0
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudUpgradeSlapInterfaceWorkflow.xml
...test.erp5.testSlapOSCloudUpgradeSlapInterfaceWorkflow.xml
+133
-0
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins.py
...ents/test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins.py
+5
-4
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
+3
-248
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow.xml
...eItem/portal_workflow/upgrade_slap_interface_workflow.xml
+108
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_approveRegistration.py
...ce_workflow/script_UpgradeDecision_approveRegistration.py
+38
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_approveRegistration.xml
...e_workflow/script_UpgradeDecision_approveRegistration.xml
+25
-3
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_checkConsistency.py
...rface_workflow/script_UpgradeDecision_checkConsistency.py
+2
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_checkConsistency.xml
...face_workflow/script_UpgradeDecision_checkConsistency.xml
+19
-3
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_notify.py
..._slap_interface_workflow/script_UpgradeDecision_notify.py
+53
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_notify.xml
...slap_interface_workflow/script_UpgradeDecision_notify.xml
+25
-3
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_requestUpgrade.py
...terface_workflow/script_UpgradeDecision_requestUpgrade.py
+56
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_requestUpgrade.xml
...erface_workflow/script_UpgradeDecision_requestUpgrade.xml
+84
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewRegistration.py
...ace_workflow/script_UpgradeDecision_reviewRegistration.py
+37
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewRegistration.xml
...ce_workflow/script_UpgradeDecision_reviewRegistration.xml
+84
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewUpgrade.py
...nterface_workflow/script_UpgradeDecision_reviewUpgrade.py
+43
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewUpgrade.xml
...terface_workflow/script_UpgradeDecision_reviewUpgrade.xml
+25
-3
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/state_draft.xml
..._workflow/upgrade_slap_interface_workflow/state_draft.xml
+81
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/transition_approve_registration.xml
...ap_interface_workflow/transition_approve_registration.xml
+68
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/transition_notify.xml
...low/upgrade_slap_interface_workflow/transition_notify.xml
+66
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/transition_request_upgrade.xml
...de_slap_interface_workflow/transition_request_upgrade.xml
+66
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/transition_review_registration.xml
...lap_interface_workflow/transition_review_registration.xml
+66
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/transition_review_upgrade.xml
...ade_slap_interface_workflow/transition_review_upgrade.xml
+66
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/variable_action.xml
...kflow/upgrade_slap_interface_workflow/variable_action.xml
+46
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/variable_actor.xml
...rkflow/upgrade_slap_interface_workflow/variable_actor.xml
+46
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/variable_comment.xml
...flow/upgrade_slap_interface_workflow/variable_comment.xml
+46
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/variable_error_message.xml
...pgrade_slap_interface_workflow/variable_error_message.xml
+42
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/variable_history.xml
...flow/upgrade_slap_interface_workflow/variable_history.xml
+46
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/variable_portal_type.xml
.../upgrade_slap_interface_workflow/variable_portal_type.xml
+42
-0
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/variable_time.xml
...orkflow/upgrade_slap_interface_workflow/variable_time.xml
+46
-0
master/bt5/slapos_pdm/bt/template_portal_type_workflow_chain_list
...t5/slapos_pdm/bt/template_portal_type_workflow_chain_list
+2
-1
master/bt5/slapos_pdm/bt/template_test_id_list
master/bt5/slapos_pdm/bt/template_test_id_list
+2
-1
master/bt5/slapos_pdm/bt/template_workflow_id_list
master/bt5/slapos_pdm/bt/template_workflow_id_list
+2
-1
No files found.
master/bt5/slapos_pdm/PortalTypeWorkflowChainTemplateItem/workflow_chain_type.xml
View file @
4eeac9b7
...
@@ -5,6 +5,6 @@
...
@@ -5,6 +5,6 @@
</chain>
</chain>
<chain>
<chain>
<type>
Upgrade Decision
</type>
<type>
Upgrade Decision
</type>
<workflow>
edit_workflow, ticket_interaction_workflow, upgrade_decision_workflow
</workflow>
<workflow>
edit_workflow, ticket_interaction_workflow, upgrade_decision_workflow
, upgrade_slap_interface_workflow
</workflow>
</chain>
</chain>
</workflow_chain>
</workflow_chain>
\ No newline at end of file
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Alarm_cancelUpgradeDecision.py
View file @
4eeac9b7
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
portal
.
portal_catalog
.
searchAndActivate
(
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
"Upgrade Decision Line"
,
portal_type
=
"Upgrade Decision Line"
,
simulation_state
=
[
"confirmed"
,
"draft"
,
"planned"
],
simulation_state
=
[
"confirmed"
,
"draft"
,
"planned"
],
...
...
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/ComputeNode_checkAndCreateUpgradeDecision.py
View file @
4eeac9b7
...
@@ -41,22 +41,18 @@ for software_release in software_release_list:
...
@@ -41,22 +41,18 @@ for software_release in software_release_list:
# If exist upgrade decision in progress try to cancel it
# If exist upgrade decision in progress try to cancel it
decision_in_progress
=
newer_release
.
\
decision_in_progress
=
newer_release
.
\
SoftwareRelease_getUpgradeDecisionInProgress
(
compute_node
.
getUid
())
SoftwareRelease_getUpgradeDecisionInProgress
(
compute_node
.
getUid
())
if
decision_in_progress
and
\
if
decision_in_progress
:
not
decision_in_progress
.
UpgradeDecision_tryToCancel
(
decision_in_progress
.
reviewRegistration
(
newer_release
.
getUrlString
()):
software_release_url
=
newer_release
.
getUrlString
())
continue
if
decision_in_progress
.
getSimulationState
()
!=
"cancelled"
:
continue
upgrade_decision
=
newer_release
.
SoftwareRelease_createUpgradeDecision
(
upgrade_decision
=
newer_release
.
SoftwareRelease_createUpgradeDecision
(
source_url
=
compute_node
.
getRelativeUrl
(),
source_url
=
compute_node
.
getRelativeUrl
(),
title
=
title
)
title
=
title
)
if
context
.
getUpgradeScope
()
==
"auto"
:
upgrade_decision
.
approveRegistration
(
upgrade_decision
.
start
()
upgrade_scope
=
compute_node
.
getUpgradeScope
(
"ask_confirmation"
))
elif
context
.
getUpgradeScope
(
"ask_confirmation"
)
==
"ask_confirmation"
\
and
upgrade_decision
.
getSimulationState
()
!=
"planned"
:
upgrade_decision
.
plan
()
upgrade_decision
.
setStartDate
(
DateTime
())
upgrade_decision_list
.
append
(
upgrade_decision
)
upgrade_decision_list
.
append
(
upgrade_decision
)
return
upgrade_decision_list
return
upgrade_decision_list
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/InstanceTree_createUpgradeDecision.py
View file @
4eeac9b7
...
@@ -2,7 +2,7 @@ from DateTime import DateTime
...
@@ -2,7 +2,7 @@ from DateTime import DateTime
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
instance_tree
=
context
instance_tree
=
context
upgrade_scope
=
context
.
getUpgradeScope
()
upgrade_scope
=
context
.
getUpgradeScope
(
"ask_confirmation"
)
if
upgrade_scope
in
[
"never"
,
"disabled"
]:
if
upgrade_scope
in
[
"never"
,
"disabled"
]:
return
return
...
@@ -22,7 +22,6 @@ if instance_tree.getSlapState() == "destroy_requested":
...
@@ -22,7 +22,6 @@ if instance_tree.getSlapState() == "destroy_requested":
return
return
tag
=
"%s_requestUpgradeDecisionCreation_inProgress"
%
instance_tree
.
getUid
()
tag
=
"%s_requestUpgradeDecisionCreation_inProgress"
%
instance_tree
.
getUid
()
activate_kw
=
{
'tag'
:
tag
}
if
portal
.
portal_activities
.
countMessageWithTag
(
tag
)
>
0
:
if
portal
.
portal_activities
.
countMessageWithTag
(
tag
)
>
0
:
# nothing to do
# nothing to do
return
return
...
@@ -52,22 +51,18 @@ if newer_release is None:
...
@@ -52,22 +51,18 @@ if newer_release is None:
decision_in_progress
=
newer_release
.
\
decision_in_progress
=
newer_release
.
\
SoftwareRelease_getUpgradeDecisionInProgress
(
instance_tree
.
getUid
())
SoftwareRelease_getUpgradeDecisionInProgress
(
instance_tree
.
getUid
())
if
decision_in_progress
and
\
if
decision_in_progress
:
not
decision_in_progress
.
UpgradeDecision_tryToCancel
(
decision_in_progress
.
reviewRegistration
(
newer_release
.
getUrlString
()):
software_release_url
=
newer_release
.
getUrlString
())
return
if
decision_in_progress
.
getSimulationState
()
!=
"cancelled"
:
return
upgrade_decision
=
newer_release
.
SoftwareRelease_createUpgradeDecision
(
upgrade_decision
=
newer_release
.
SoftwareRelease_createUpgradeDecision
(
source_url
=
instance_tree
.
getRelativeUrl
(),
source_url
=
instance_tree
.
getRelativeUrl
(),
title
=
decision_title
title
=
decision_title
)
)
with
upgrade_decision
.
defaultActivateParameterDict
(
activate_kw
):
upgrade_decision
.
plan
()
upgrade_decision
.
setStartDate
(
DateTime
())
if
upgrade_scope
==
"auto"
:
upgrade_decision
.
start
()
# Prevent concurrent transaction to create 2 upgrade decision for the same instance_tree
upgrade_decision
.
approveRegistration
(
instance_tree
.
serialize
(
)
upgrade_scope
=
upgrade_scope
)
return
upgrade_decision
return
upgrade_decision
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecisionLine_cancel.py
View file @
4eeac9b7
instance_tree
=
context
.
getAggregateValue
(
portal_type
=
"Instance Tree"
)
context
.
getParentValue
().
reviewUpgrade
()
software_release
=
context
.
getAggregateValue
(
portal_type
=
"Software Release"
)
upgrade_decision
=
context
.
getParentValue
()
if
upgrade_decision
.
getSimulationState
()
==
"cancelled"
:
return
if
software_release
.
getValidationState
()
==
"archived"
:
upgrade_decision
.
cancel
(
comment
=
"Software Release is archived."
)
return
if
instance_tree
is
not
None
:
if
instance_tree
.
getUpgradeScope
()
in
[
'never'
,
'disabled'
]:
upgrade_decision
.
cancel
(
"Upgrade scope was disabled on the related Instance Tree"
)
elif
instance_tree
.
getSlapState
()
==
"destroy_requested"
:
upgrade_decision
.
cancel
(
comment
=
"Instance Tree is destroyed."
)
elif
instance_tree
.
getUrlString
()
==
software_release
.
getUrlString
():
upgrade_decision
.
cancel
(
comment
=
"Instance tree is already upgraded."
)
return
compute_node
=
context
.
getAggregateValue
(
portal_type
=
"Compute Node"
)
if
compute_node
is
not
None
:
if
compute_node
.
getUpgradeScope
()
in
[
'never'
,
'disabled'
]:
upgrade_decision
.
cancel
(
"Upgrade scope was disabled on the related Instance Tree"
)
return
elif
compute_node
.
getAllocationScope
()
in
[
"closed/forever"
,
"closed/termination"
]:
upgrade_decision
.
cancel
(
comment
=
"Compute Node is closed."
)
return
already_deployed
=
len
(
context
.
portal_catalog
(
limit
=
1
,
portal_type
=
"Compute Partition"
,
parent_reference
=
compute_node
.
getReference
(),
software_release_url
=
software_release
.
getUrlString
()))
if
already_deployed
:
upgrade_decision
.
cancel
(
comment
=
"Compute Node already has the software release"
)
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_getAggregateValue.py
View file @
4eeac9b7
document_list
=
[]
document_list
=
[]
for
decision_line
in
context
.
contentValues
():
for
decision_line
in
context
.
contentValues
():
document_list
.
extend
(
try
:
decision_line
.
getAggregateValueList
(
portal_type
=
document_portal_type
))
document_list
.
extend
(
decision_line
.
getAggregateValueList
(
portal_type
=
document_portal_type
))
except
:
raise
ValueError
(
context
)
if
len
(
document_list
)
>
1
:
if
len
(
document_list
)
>
1
:
raise
ValueError
(
"It is only allowed to have more them 1 %s"
%
document_list
)
raise
ValueError
(
"It is only allowed to have more them 1 %s"
%
document_list
)
...
...
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_getSoftwareRelease.py
deleted
100644 → 0
View file @
60948897
software_release_list
=
[]
for
decision_line
in
context
.
contentValues
():
software_release_list
.
extend
(
decision_line
.
getAggregateValueList
(
portal_type
=
"Software Release"
))
if
len
(
software_release_list
)
>
1
:
raise
ValueError
(
"It is only allowed to have more them 1 Software Release"
)
if
len
(
software_release_list
)
==
0
:
return
None
return
software_release_list
[
0
]
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_isUpgradeFinished.py
View file @
4eeac9b7
...
@@ -2,7 +2,7 @@ portal = context.getPortalObject()
...
@@ -2,7 +2,7 @@ portal = context.getPortalObject()
instance_tree
=
context
.
UpgradeDecision_getAggregateValue
(
"Instance Tree"
)
instance_tree
=
context
.
UpgradeDecision_getAggregateValue
(
"Instance Tree"
)
compute_node
=
context
.
UpgradeDecision_getAggregateValue
(
"Compute Node"
)
compute_node
=
context
.
UpgradeDecision_getAggregateValue
(
"Compute Node"
)
software_release
=
context
.
UpgradeDecision_get
SoftwareRelease
(
)
software_release
=
context
.
UpgradeDecision_get
AggregateValue
(
"Software Release"
)
if
instance_tree
is
not
None
:
if
instance_tree
is
not
None
:
if
instance_tree
.
getUrlString
()
==
software_release
.
getUrlString
():
if
instance_tree
.
getUrlString
()
==
software_release
.
getUrlString
():
...
...
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_notify.py
View file @
4eeac9b7
from
DateTime
import
DateTime
from
DateTime
import
DateTime
# Review if the upgrade is applicable before notify.
context
.
reviewUpgrade
()
if
context
.
getSimulationState
()
!=
'planned'
:
if
context
.
getSimulationState
()
!=
'planned'
:
# XXX Don't notify the ones which are not planned.
# XXX Don't notify the ones which are not planned.
return
return
portal
=
context
.
getPortalObject
()
portal
=
context
.
getPortalObject
()
...
@@ -21,8 +24,8 @@ mapping_dict = {
...
@@ -21,8 +24,8 @@ mapping_dict = {
'software_release_name'
:
software_release
.
getTitle
(),
'software_release_name'
:
software_release
.
getTitle
(),
'software_release_reference'
:
software_release
.
getReference
(),
'software_release_reference'
:
software_release
.
getReference
(),
'new_software_release_url'
:
software_release
.
getUrlString
(),
'new_software_release_url'
:
software_release
.
getUrlString
(),
}
}
if
instance_tree
is
not
None
:
if
instance_tree
is
not
None
:
notification_message_reference
=
'slapos-upgrade-instance-tree.notification'
notification_message_reference
=
'slapos-upgrade-instance-tree.notification'
title
=
"New Upgrade available for %s"
%
instance_tree
.
getTitle
()
title
=
"New Upgrade available for %s"
%
instance_tree
.
getTitle
()
...
@@ -30,11 +33,8 @@ if instance_tree is not None:
...
@@ -30,11 +33,8 @@ if instance_tree is not None:
'instance_tree_title'
:
instance_tree
.
getTitle
(),
'instance_tree_title'
:
instance_tree
.
getTitle
(),
'old_software_release_url'
:
instance_tree
.
getUrlString
()})
'old_software_release_url'
:
instance_tree
.
getUrlString
()})
elif
compute_node
is
not
None
:
elif
compute_node
is
not
None
:
notification_message_reference
=
'slapos-upgrade-compute-node.notification'
notification_message_reference
=
'slapos-upgrade-compute-node.notification'
title
=
"New Software available for Installation at %s"
%
compute_node
.
getTitle
()
title
=
"New Software available for Installation at %s"
%
compute_node
.
getTitle
()
mapping_dict
.
update
(
**
{
'compute_node_title'
:
compute_node
.
getTitle
(),
mapping_dict
.
update
(
**
{
'compute_node_title'
:
compute_node
.
getTitle
(),
'compute_node_reference'
:
compute_node
.
getReference
()})
'compute_node_reference'
:
compute_node
.
getReference
()})
...
@@ -49,8 +49,10 @@ notification_message = portal.portal_notifications.getDocumentValue(
...
@@ -49,8 +49,10 @@ notification_message = portal.portal_notifications.getDocumentValue(
message
=
notification_message
.
asEntireHTML
(
message
=
notification_message
.
asEntireHTML
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
mapping_dict
})
substitution_method_parameter_dict
=
{
'mapping_dict'
:
mapping_dict
})
event
=
context
.
SupportRequest_trySendNotificationMessage
(
title
,
context
.
notify
(
message_title
=
title
,
message
,
person
.
getRelativeUrl
())
message
=
message
,
destination_relative_url
=
person
.
getRelativeUrl
())
event
=
context
.
REQUEST
.
get
(
"upgrade_decision_notified_item"
)
if
event
is
not
None
:
if
event
is
not
None
:
context
.
confirm
()
context
.
confirm
()
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_notifyDelivered.py
View file @
4eeac9b7
...
@@ -15,7 +15,7 @@ if not person:
...
@@ -15,7 +15,7 @@ if not person:
instance_tree
=
context
.
UpgradeDecision_getAggregateValue
(
"Instance Tree"
)
instance_tree
=
context
.
UpgradeDecision_getAggregateValue
(
"Instance Tree"
)
compute_node
=
context
.
UpgradeDecision_getAggregateValue
(
"Compute Node"
)
compute_node
=
context
.
UpgradeDecision_getAggregateValue
(
"Compute Node"
)
software_release
=
context
.
UpgradeDecision_get
SoftwareRelease
(
)
software_release
=
context
.
UpgradeDecision_get
AggregateValue
(
"Software Release"
)
software_product_title
=
software_release
.
getAggregateTitle
(
software_product_title
=
software_release
.
getAggregateTitle
(
portal_type
=
"Software Product"
)
portal_type
=
"Software Product"
)
...
@@ -52,8 +52,10 @@ notification_message = portal.portal_notifications.getDocumentValue(
...
@@ -52,8 +52,10 @@ notification_message = portal.portal_notifications.getDocumentValue(
message
=
notification_message
.
asEntireHTML
(
message
=
notification_message
.
asEntireHTML
(
substitution_method_parameter_dict
=
{
'mapping_dict'
:
mapping_dict
})
substitution_method_parameter_dict
=
{
'mapping_dict'
:
mapping_dict
})
event
=
context
.
SupportRequest_trySendNotificationMessage
(
title
,
context
.
notify
(
message_title
=
title
,
message
,
person
.
getRelativeUrl
())
message
=
message
,
destination_relative_url
=
person
.
getRelativeUrl
())
event
=
context
.
REQUEST
.
get
(
"upgrade_decision_notified_item"
)
if
event
is
not
None
:
if
event
is
not
None
:
context
.
setStopDate
(
DateTime
())
context
.
setStopDate
(
DateTime
())
...
...
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_processUpgrade.py
View file @
4eeac9b7
if
context
.
UpgradeDecision_upgradeInstanceTree
():
return
context
.
requestUpgrade
()
return
True
if
context
.
UpgradeDecision_upgradeComputeNode
():
return
True
return
False
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_processUpgrade.xml
View file @
4eeac9b7
...
@@ -50,7 +50,7 @@
...
@@ -50,7 +50,7 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
**kw
</string>
</value>
<value>
<string></string>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
...
...
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_upgradeComputeNode.py
deleted
100644 → 0
View file @
60948897
if
context
.
getSimulationState
()
!=
'started'
:
# Update Decision is not on started state, Upgrade is not possible!
return
False
compute_node
=
context
.
UpgradeDecision_getAggregateValue
(
"Compute Node"
)
software_release
=
context
.
UpgradeDecision_getSoftwareRelease
()
if
compute_node
is
None
:
return
False
if
software_release
is
None
:
return
False
software_release_url
=
software_release
.
getUrlString
()
compute_node
.
requestSoftwareRelease
(
software_release_url
=
software_release_url
,
state
=
"available"
)
context
.
stop
()
return
True
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudUpgradeSlapInterfaceWorkflow.py
0 → 100644
View file @
4eeac9b7
This diff is collapsed.
Click to expand it.
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSCloudUpgradeSlapInterfaceWorkflow.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Test Component"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_recorded_property_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
testSlapOSCloudUpgradeSlapInterfaceWorkflow
</string>
</value>
</item>
<item>
<key>
<string>
default_source_reference
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
test.erp5.testSlapOSCloudUpgradeSlapInterfaceWorkflow
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Test Component
</string>
</value>
</item>
<item>
<key>
<string>
sid
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
text_content_error_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
text_content_warning_message
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
version
</string>
</key>
<value>
<string>
erp5
</string>
</value>
</item>
<item>
<key>
<string>
workflow_history
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
component_validation_workflow
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.Workflow"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins.py
View file @
4eeac9b7
...
@@ -287,8 +287,9 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
...
@@ -287,8 +287,9 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
self
.
assertEqual
(
up_decision
.
UpgradeDecision_getAggregateValue
(
"Instance Tree"
).
\
self
.
assertEqual
(
up_decision
.
UpgradeDecision_getAggregateValue
(
"Instance Tree"
).
\
getReference
(),
instance_tree
.
getReference
())
getReference
(),
instance_tree
.
getReference
())
self
.
assertEqual
(
up_decision
.
UpgradeDecision_getSoftwareRelease
().
\
self
.
assertEqual
(
software_release2
.
getUrlString
(),
getUrlString
(),
software_release2
.
getUrlString
())
up_decision
.
UpgradeDecision_getAggregateValue
(
"Software Release"
).
\
getUrlString
())
self
.
tic
()
self
.
tic
()
up_decision2
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
up_decision2
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
...
@@ -331,7 +332,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
...
@@ -331,7 +332,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
up_decision2
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
up_decision2
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
self
.
assertEqual
(
up_decision2
.
getSimulationState
(),
'planned'
)
self
.
assertEqual
(
up_decision2
.
getSimulationState
(),
'planned'
)
self
.
assertEqual
(
up_decision
.
getSimulationState
(),
'cancelled'
)
self
.
assertEqual
(
up_decision
.
getSimulationState
(),
'cancelled'
)
release
=
up_decision2
.
UpgradeDecision_get
SoftwareRelease
(
)
release
=
up_decision2
.
UpgradeDecision_get
AggregateValue
(
"Software Release"
)
self
.
assertEqual
(
release
.
getUrlString
(),
self
.
assertEqual
(
release
.
getUrlString
(),
software_release3
.
getUrlString
())
software_release3
.
getUrlString
())
...
@@ -414,7 +415,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
...
@@ -414,7 +415,7 @@ class TestSlapOSPDMCreateUpgradeDecisionSkins(TestSlapOSPDMMixinSkins):
decision2
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
decision2
=
instance_tree
.
InstanceTree_createUpgradeDecision
()
self
.
assertEqual
(
decision2
.
getSimulationState
(),
'planned'
)
self
.
assertEqual
(
decision2
.
getSimulationState
(),
'planned'
)
self
.
assertEqual
(
up_decision
.
getSimulationState
(),
'rejected'
)
self
.
assertEqual
(
up_decision
.
getSimulationState
(),
'rejected'
)
release
=
decision2
.
UpgradeDecision_get
SoftwareRelease
(
)
release
=
decision2
.
UpgradeDecision_get
AggregateValue
(
"Software Release"
)
self
.
assertEqual
(
release
.
getUrlString
(),
self
.
assertEqual
(
release
.
getUrlString
(),
software_release3
.
getUrlString
())
software_release3
.
getUrlString
())
\ No newline at end of file
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
View file @
4eeac9b7
This diff is collapsed.
Click to expand it.
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_count
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_mt_index
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAM=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
_tree
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAQ=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
source/portal_workflow/upgrade_slap_interface_workflow/state_draft
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
default_reference
</string>
</key>
<value>
<string>
person_slap_interface_workflow
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
upgrade_slap_interface_workflow
</string>
</value>
</item>
<item>
<key>
<string>
language
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
manager_bypass
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow
</string>
</value>
</item>
<item>
<key>
<string>
state_variable
</string>
</key>
<value>
<string>
slap_state
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Upgrade Slap Interface Workflow
</string>
</value>
</item>
<item>
<key>
<string>
workflow_managed_permission
</string>
</key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"Length"
module=
"BTrees.Length"
/>
</pickle>
<pickle>
<int>
0
</int>
</pickle>
</record>
<record
id=
"3"
aka=
"AAAAAAAAAAM="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"OOBTree"
module=
"BTrees.OOBTree"
/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_approveRegistration.py
0 → 100644
View file @
4eeac9b7
upgrade_decision
=
state_change
[
"object"
]
from
DateTime
import
DateTime
portal
=
upgrade_decision
.
getPortalObject
()
document
=
upgrade_decision
.
UpgradeDecision_getAggregateValue
(
"Instance Tree"
)
if
document
is
None
:
document
=
upgrade_decision
.
UpgradeDecision_getAggregateValue
(
"Compute Node"
)
if
document
is
None
:
raise
ValueError
(
"No Compute Node or Instance Tree associated to upgrade."
)
# Get required arguments
kwargs
=
state_change
.
kwargs
# Required args
# Raise TypeError if all parameters are not provided
try
:
upgrade_scope
=
kwargs
[
'upgrade_scope'
]
except
KeyError
:
raise
TypeError
(
"UpgradeDecision_approveRegistration takes exactly 1 arguments"
)
tag
=
"%s_requestUpgradeDecisionCreation_inProgress"
%
document
.
getUid
()
activate_kw
=
{
'tag'
:
tag
}
if
portal
.
portal_activities
.
countMessageWithTag
(
tag
)
>
0
:
# nothing to do
return
with
upgrade_decision
.
defaultActivateParameterDict
(
activate_kw
):
if
upgrade_decision
.
getSimulationState
()
==
"draft"
:
upgrade_decision
.
plan
()
upgrade_decision
.
setStartDate
(
DateTime
())
if
upgrade_scope
==
"auto"
:
if
upgrade_decision
.
getSimulationState
()
==
"planned"
:
upgrade_decision
.
start
()
# Prevent concurrent transaction to create 2 upgrade decision for the same instance_tree
document
.
serialize
()
master/bt5/slapos_pdm/
SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_upgradeInstanceTree
.xml
→
master/bt5/slapos_pdm/
WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_approveRegistration
.xml
View file @
4eeac9b7
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<ZopeData>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<pickle>
<global
name=
"
PythonScript"
module=
"Products.PythonScripts.PythonScript
"
/>
<global
name=
"
Workflow Script"
module=
"erp5.portal_type
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
...
@@ -50,11 +50,33 @@
...
@@ -50,11 +50,33 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
<value>
<string>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
UpgradeDecision_upgradeInstanceTree
</string>
</value>
<value>
<string>
script_UpgradeDecision_approveRegistration
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Script
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
UpgradeDecision_approveRegistration
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_checkConsistency.py
0 → 100644
View file @
4eeac9b7
upgrade_decision
=
state_change
[
'object'
]
upgrade_decision
.
Base_checkConsistency
()
master/bt5/slapos_pdm/
SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_upgradeComputeNode
.xml
→
master/bt5/slapos_pdm/
WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_checkConsistency
.xml
View file @
4eeac9b7
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<ZopeData>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<pickle>
<global
name=
"
PythonScript"
module=
"Products.PythonScripts.PythonScript
"
/>
<global
name=
"
Workflow Script"
module=
"erp5.portal_type
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
...
@@ -50,11 +50,27 @@
...
@@ -50,11 +50,27 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
<value>
<string>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
UpgradeDecision_upgradeComputeNode
</string>
</value>
<value>
<string>
script_UpgradeDecision_checkConsistency
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Script
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<none/>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_notify.py
0 → 100644
View file @
4eeac9b7
upgrade_decision
=
state_change
[
"object"
]
from
DateTime
import
DateTime
portal
=
context
.
getPortalObject
()
# Get required arguments
kwargs
=
state_change
.
kwargs
# Required args
# Raise TypeError if all parameters are not provided
try
:
message_title
=
kwargs
[
'message_title'
]
message
=
kwargs
[
'message'
]
destination_relative_url
=
kwargs
[
'destination_relative_url'
]
except
KeyError
:
raise
TypeError
(
"UpgradeDecision_requestEvent takes exactly 3 arguments"
)
resource
=
portal
.
service_module
.
slapos_crm_information
.
getRelativeUrl
()
# create Web message if needed for this ticket
last_event
=
portal
.
portal_catalog
.
getResultValue
(
title
=
message_title
,
follow_up_uid
=
upgrade_decision
.
getUid
(),
sort_on
=
[(
'delivery.start_date'
,
'DESC'
)],
)
if
last_event
:
# User has already been notified for this problem.
return
last_event
transactional_event
=
context
.
REQUEST
.
get
(
"upgrade_decision_notified_item"
,
None
)
if
transactional_event
is
not
None
:
if
(
transactional_event
.
getFollowUpUid
()
==
upgrade_decision
.
getUid
())
and
\
(
transactional_event
.
getTitle
()
==
message_title
):
return
transactional_event
template
=
portal
.
restrictedTraverse
(
portal
.
portal_preferences
.
getPreferredWebMessageTemplate
())
event
=
template
.
Base_createCloneDocument
(
batch_mode
=
1
)
event
.
edit
(
title
=
message_title
,
text_content
=
message
,
start_date
=
DateTime
(),
resource
=
resource
,
source
=
upgrade_decision
.
getSource
(),
destination
=
destination_relative_url
,
follow_up
=
upgrade_decision
.
getRelativeUrl
(),
)
event
.
stop
()
event
.
deliver
()
upgrade_decision
.
serialize
()
upgrade_decision
.
REQUEST
.
set
(
"upgrade_decision_notified_item"
,
event
)
master/bt5/slapos_pdm/
SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_getSoftwareRelease
.xml
→
master/bt5/slapos_pdm/
WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_notify
.xml
View file @
4eeac9b7
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<ZopeData>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<pickle>
<global
name=
"
PythonScript"
module=
"Products.PythonScripts.PythonScript
"
/>
<global
name=
"
Workflow Script"
module=
"erp5.portal_type
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
...
@@ -50,11 +50,33 @@
...
@@ -50,11 +50,33 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string></string>
</value>
<value>
<string>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
UpgradeDecision_getSoftwareRelease
</string>
</value>
<value>
<string>
script_UpgradeDecision_notify
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Script
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
UpgradeDecision_notify
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
master/bt5/slapos_pdm/
SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_upgradeInstanceTre
e.py
→
master/bt5/slapos_pdm/
WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_requestUpgrad
e.py
View file @
4eeac9b7
if
context
.
getSimulationState
()
!=
'started'
:
upgrade_decision
=
state_change
[
"object"
]
from
DateTime
import
DateTime
if
upgrade_decision
.
getSimulationState
()
!=
'started'
:
# Update Decision is not on started state, Upgrade is not possible!
# Update Decision is not on started state, Upgrade is not possible!
return
False
return
instance_tree
=
upgrade_decision
.
UpgradeDecision_getAggregateValue
(
"Instance Tree"
)
software_release
=
upgrade_decision
.
UpgradeDecision_getAggregateValue
(
"Software Release"
)
compute_node
=
upgrade_decision
.
UpgradeDecision_getAggregateValue
(
"Compute Node"
)
i
nstance_tree
=
context
.
UpgradeDecision_getAggregateValue
(
"Instance Tree"
)
i
f
software_release
is
None
:
software_release
=
context
.
UpgradeDecision_getSoftwareRelease
()
return
if
instance_tree
is
None
:
if
compute_node
is
None
and
instance_tree
is
None
:
return
False
return
if
software_release
is
None
:
if
compute_node
is
not
None
and
instance_tree
is
not
None
:
r
eturn
False
r
aise
ValueError
(
"Something is wrong, you cannot upgrade Compute Node and Instance Tree on the same decision."
)
software_release_url
=
software_release
.
getUrlString
()
software_release_url
=
software_release
.
getUrlString
()
person
=
instance_tree
.
getDestinationSectionValue
(
portal_type
=
"Person"
)
if
compute_node
is
not
None
:
compute_node
.
requestSoftwareRelease
(
software_release_url
=
software_release_url
,
state
=
"available"
)
upgrade_decision
.
stop
(
comment
=
"Upgrade Processed for the Compute Node!"
)
return
# Test if the Software is available at the ComputeNode.
# Test if the Software is available at the ComputeNode.
if
not
instance_tree
.
InstanceTree_isUpgradePossible
(
if
not
instance_tree
.
InstanceTree_isUpgradePossible
(
...
@@ -27,7 +40,8 @@ elif status == "stop_requested":
...
@@ -27,7 +40,8 @@ elif status == "stop_requested":
state
=
"stopped"
state
=
"stopped"
elif
status
==
"destroy_requested"
:
elif
status
==
"destroy_requested"
:
state
=
"destroyed"
state
=
"destroyed"
person
=
instance_tree
.
getDestinationSectionValue
(
portal_type
=
"Person"
)
person
.
requestSoftwareInstance
(
person
.
requestSoftwareInstance
(
state
=
state
,
state
=
state
,
software_release
=
software_release_url
,
software_release
=
software_release_url
,
...
@@ -38,6 +52,5 @@ person.requestSoftwareInstance(
...
@@ -38,6 +52,5 @@ person.requestSoftwareInstance(
shared
=
instance_tree
.
isRootSlave
()
shared
=
instance_tree
.
isRootSlave
()
)
)
context
.
stop
()
upgrade_decision
.
stop
(
comment
=
"Upgrade Processed for the Instance Tree!"
)
return
True
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_requestUpgrade.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Script"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
script_UpgradeDecision_requestUpgrade
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Script
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
UpgradeDecision_requestUpgrade
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/
SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_tryToCancel
.py
→
master/bt5/slapos_pdm/
WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewRegistration
.py
View file @
4eeac9b7
upgrade_decision
=
context
upgrade_decision
=
state_change
[
"object"
]
from
DateTime
import
DateTime
cancellable_state_list
=
[
'confirmed'
,
'planned'
]
cancellable_state_list
=
[
'confirmed'
,
'planned'
]
require_state_list
=
[
'rejected'
,
'confirmed'
,
'planned'
]
require_state_list
=
[
'rejected'
,
'confirmed'
,
'planned'
]
simulation_state
=
upgrade_decision
.
getSimulationState
()
simulation_state
=
upgrade_decision
.
getSimulationState
()
# Get required arguments
kwargs
=
state_change
.
kwargs
# Required args
# Raise TypeError if all parameters are not provided
try
:
software_release_url
=
kwargs
[
'software_release_url'
]
except
KeyError
:
raise
TypeError
(
"UpgradeDecision_reviewRegistration takes exactly 1 arguments"
)
if
simulation_state
in
require_state_list
:
if
simulation_state
in
require_state_list
:
current_release
=
upgrade_decision
.
UpgradeDecision_get
SoftwareRelease
(
)
current_release
=
upgrade_decision
.
UpgradeDecision_get
AggregateValue
(
"Software Release"
)
if
not
current_release
:
if
not
current_release
:
# This upgrade decision is not valid
# This upgrade decision is not valid
return
False
return
instance_tree
=
context
.
UpgradeDecision_getAggregateValue
(
"Instance Tree"
)
instance_tree
=
upgrade_decision
.
UpgradeDecision_getAggregateValue
(
"Instance Tree"
)
if
instance_tree
is
not
None
:
if
instance_tree
is
not
None
:
current_instance_tree_release
=
instance_tree
.
getUrlString
()
current_instance_tree_release
=
instance_tree
.
getUrlString
()
if
current_instance_tree_release
==
new_url_string
:
if
current_instance_tree_release
==
software_release_url
:
if
simulation_state
in
cancellable_state_list
:
if
simulation_state
in
cancellable_state_list
:
upgrade_decision
.
cancel
()
upgrade_decision
.
cancel
(
comment
=
"Instance tree is already upgraded."
)
return
True
return
if
current_release
.
getUrlString
()
==
new_url_string
:
if
current_release
.
getUrlString
()
==
software_release_url
:
# Cannot cancel because the software releases are the same
# Cannot cancel because the software releases are the same
return
False
return
False
if
simulation_state
in
cancellable_state_list
:
if
simulation_state
in
cancellable_state_list
:
upgrade_decision
.
cancel
()
upgrade_decision
.
cancel
()
return
True
else
:
return
False
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewRegistration.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Script"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
script_UpgradeDecision_reviewRegistration
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Script
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
UpgradeDecision_reviewRegistration
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewUpgrade.py
0 → 100644
View file @
4eeac9b7
upgrade_decision
=
state_change
[
"object"
]
from
DateTime
import
DateTime
portal
=
upgrade_decision
.
getPortalObject
()
instance_tree
=
upgrade_decision
.
UpgradeDecision_getAggregateValue
(
"Instance Tree"
)
software_release
=
upgrade_decision
.
UpgradeDecision_getAggregateValue
(
"Software Release"
)
if
upgrade_decision
.
getSimulationState
()
==
"cancelled"
:
return
if
software_release
.
getValidationState
()
==
"archived"
:
upgrade_decision
.
cancel
(
comment
=
"Software Release is archived."
)
return
if
instance_tree
is
not
None
:
if
instance_tree
.
getUpgradeScope
()
in
[
'never'
,
'disabled'
]:
upgrade_decision
.
cancel
(
"Upgrade scope was disabled on the related Instance Tree"
)
elif
instance_tree
.
getSlapState
()
==
"destroy_requested"
:
upgrade_decision
.
cancel
(
comment
=
"Instance Tree is destroyed."
)
elif
instance_tree
.
getUrlString
()
==
software_release
.
getUrlString
():
upgrade_decision
.
cancel
(
comment
=
"Instance tree is already upgraded."
)
return
compute_node
=
upgrade_decision
.
UpgradeDecision_getAggregateValue
(
"Compute Node"
)
if
compute_node
is
not
None
:
if
compute_node
.
getUpgradeScope
()
in
[
'never'
,
'disabled'
]:
upgrade_decision
.
cancel
(
"Upgrade scope was disabled on the related Instance Tree"
)
return
elif
compute_node
.
getAllocationScope
()
in
[
"closed/forever"
,
"closed/termination"
]:
upgrade_decision
.
cancel
(
comment
=
"Compute Node is closed."
)
return
already_deployed
=
len
(
portal
.
portal_catalog
(
limit
=
1
,
portal_type
=
"Compute Partition"
,
parent_reference
=
compute_node
.
getReference
(),
software_release_url
=
software_release
.
getUrlString
()))
if
already_deployed
:
upgrade_decision
.
cancel
(
comment
=
"Compute Node already has the software release"
)
master/bt5/slapos_pdm/
SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecision_tryToCancel
.xml
→
master/bt5/slapos_pdm/
WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewUpgrade
.xml
View file @
4eeac9b7
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
<ZopeData>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<pickle>
<global
name=
"
PythonScript"
module=
"Products.PythonScripts.PythonScript
"
/>
<global
name=
"
Workflow Script"
module=
"erp5.portal_type
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<dictionary>
<dictionary>
...
@@ -50,11 +50,33 @@
...
@@ -50,11 +50,33 @@
</item>
</item>
<item>
<item>
<key>
<string>
_params
</string>
</key>
<key>
<string>
_params
</string>
</key>
<value>
<string>
new_url_string
</string>
</value>
<value>
<string>
state_change
</string>
</value>
</item>
<item>
<key>
<string>
_proxy_roles
</string>
</key>
<value>
<tuple>
<string>
Manager
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
</item>
<item>
<item>
<key>
<string>
id
</string>
</key>
<key>
<string>
id
</string>
</key>
<value>
<string>
UpgradeDecision_tryToCancel
</string>
</value>
<value>
<string>
script_UpgradeDecision_reviewUpgrade
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Script
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
UpgradeDecision_reviewUpgrade
</string>
</value>
</item>
</item>
</dictionary>
</dictionary>
</pickle>
</pickle>
...
...
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/state_draft.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow State"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
acquire_permission
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
destination/portal_workflow/upgrade_slap_interface_workflow/transition_approve_registration
</string>
<string>
destination/portal_workflow/upgrade_slap_interface_workflow/transition_notify
</string>
<string>
destination/portal_workflow/upgrade_slap_interface_workflow/transition_request_upgrade
</string>
<string>
destination/portal_workflow/upgrade_slap_interface_workflow/transition_review_registration
</string>
<string>
destination/portal_workflow/upgrade_slap_interface_workflow/transition_review_upgrade
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
comment
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
state_draft
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow State
</string>
</value>
</item>
<item>
<key>
<string>
state_permission_role_list_dict
</string>
</key>
<value>
<persistent>
<string
encoding=
"base64"
>
AAAAAAAAAAI=
</string>
</persistent>
</value>
</item>
<item>
<key>
<string>
state_type
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Draft
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
<record
id=
"2"
aka=
"AAAAAAAAAAI="
>
<pickle>
<global
name=
"PersistentMapping"
module=
"Persistence.mapping"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
data
</string>
</key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/transition_approve_registration.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Transition"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
action_name
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/workflow
</string>
<string>
before_script/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_checkConsistency
</string>
<string>
after_script/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_approveRegistration
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
guard_permission
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
transition_approve_registration
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Transition
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Approve Registration
</string>
</value>
</item>
<item>
<key>
<string>
trigger_type
</string>
</key>
<value>
<int>
2
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/transition_notify.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Transition"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
action_name
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/workflow
</string>
<string>
before_script/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_checkConsistency
</string>
<string>
after_script/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_notify
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Create an event for the Upgrade Decision
</string>
</value>
</item>
<item>
<key>
<string>
guard_permission
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
transition_notify
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Transition
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Notify
</string>
</value>
</item>
<item>
<key>
<string>
trigger_type
</string>
</key>
<value>
<int>
2
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/transition_request_upgrade.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Transition"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
action_name
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/workflow
</string>
<string>
before_script/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_checkConsistency
</string>
<string>
after_script/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_requestUpgrade
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Perform the Upgrade
</string>
</value>
</item>
<item>
<key>
<string>
guard_permission
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
transition_request_upgrade
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Transition
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Request Upgrade
</string>
</value>
</item>
<item>
<key>
<string>
trigger_type
</string>
</key>
<value>
<int>
2
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/transition_review_registration.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Transition"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
action_name
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/workflow
</string>
<string>
before_script/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_checkConsistency
</string>
<string>
after_script/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewRegistration
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Cancel if the current upgrade isn\'t valid anymore.
</string>
</value>
</item>
<item>
<key>
<string>
guard_permission
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
transition_review_registration
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Transition
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Review Registration
</string>
</value>
</item>
<item>
<key>
<string>
trigger_type
</string>
</key>
<value>
<int>
2
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/transition_review_upgrade.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Transition"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
action_name
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
categories
</string>
</key>
<value>
<tuple>
<string>
action_type/workflow
</string>
<string>
before_script/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_checkConsistency
</string>
<string>
after_script/portal_workflow/upgrade_slap_interface_workflow/script_UpgradeDecision_reviewUpgrade
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Review if the upgrade still applicable
</string>
</value>
</item>
<item>
<key>
<string>
guard_permission
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
icon
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
transition_review_upgrade
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Transition
</string>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<string>
Review Upgrade
</string>
</value>
</item>
<item>
<key>
<string>
trigger_type
</string>
</key>
<value>
<int>
2
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/variable_action.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Variable"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
automatic_update
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
The last transition
</string>
</value>
</item>
<item>
<key>
<string>
for_catalog
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
variable_action
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Variable
</string>
</value>
</item>
<item>
<key>
<string>
status_included
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
variable_default_expression
</string>
</key>
<value>
<string>
transition/getReference|nothing
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/variable_actor.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Variable"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
automatic_update
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
The name of the user who performed the last transition
</string>
</value>
</item>
<item>
<key>
<string>
for_catalog
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
variable_actor
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Variable
</string>
</value>
</item>
<item>
<key>
<string>
status_included
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
variable_default_expression
</string>
</key>
<value>
<string>
user/getUserName
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/variable_comment.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Variable"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
automatic_update
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Comments about the last transition
</string>
</value>
</item>
<item>
<key>
<string>
for_catalog
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
variable_comment
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Variable
</string>
</value>
</item>
<item>
<key>
<string>
status_included
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
variable_default_expression
</string>
</key>
<value>
<string>
python:state_change.kwargs.get(\'comment\', \'\')
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/variable_error_message.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Variable"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
automatic_update
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Error message if validation failed
</string>
</value>
</item>
<item>
<key>
<string>
for_catalog
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
variable_error_message
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Variable
</string>
</value>
</item>
<item>
<key>
<string>
status_included
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/variable_history.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Variable"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
automatic_update
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Provides access to workflow history
</string>
</value>
</item>
<item>
<key>
<string>
for_catalog
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
variable_history
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Variable
</string>
</value>
</item>
<item>
<key>
<string>
status_included
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
variable_default_expression
</string>
</key>
<value>
<string>
state_change/getHistory
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/variable_portal_type.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Variable"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
automatic_update
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
portal type (use as filter for worklists)
</string>
</value>
</item>
<item>
<key>
<string>
for_catalog
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
variable_portal_type
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Variable
</string>
</value>
</item>
<item>
<key>
<string>
status_included
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/WorkflowTemplateItem/portal_workflow/upgrade_slap_interface_workflow/variable_time.xml
0 → 100644
View file @
4eeac9b7
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"Workflow Variable"
module=
"erp5.portal_type"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
automatic_update
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<string>
Time of the last transition
</string>
</value>
</item>
<item>
<key>
<string>
for_catalog
</string>
</key>
<value>
<int>
0
</int>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
variable_time
</string>
</value>
</item>
<item>
<key>
<string>
portal_type
</string>
</key>
<value>
<string>
Workflow Variable
</string>
</value>
</item>
<item>
<key>
<string>
status_included
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
title
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
variable_default_expression
</string>
</key>
<value>
<string>
state_change/getDateTime
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/bt/template_portal_type_workflow_chain_list
View file @
4eeac9b7
...
@@ -2,4 +2,5 @@ Software Product | -validation_workflow
...
@@ -2,4 +2,5 @@ Software Product | -validation_workflow
Software Product | commerce_validation_workflow
Software Product | commerce_validation_workflow
Upgrade Decision | edit_workflow
Upgrade Decision | edit_workflow
Upgrade Decision | ticket_interaction_workflow
Upgrade Decision | ticket_interaction_workflow
Upgrade Decision | upgrade_decision_workflow
Upgrade Decision | upgrade_decision_workflow
\ No newline at end of file
Upgrade Decision | upgrade_slap_interface_workflow
\ No newline at end of file
master/bt5/slapos_pdm/bt/template_test_id_list
View file @
4eeac9b7
test.erp5.testSlapOSPDMAlarm
test.erp5.testSlapOSPDMAlarm
test.erp5.testSlapOSPDMSkins
test.erp5.testSlapOSPDMSkins
test.erp5.testSlapOSPDMDestroySoftwareInstallationWithArchivedSoftwareReleaseAlarm
test.erp5.testSlapOSPDMDestroySoftwareInstallationWithArchivedSoftwareReleaseAlarm
test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins
test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins
\ No newline at end of file
test.erp5.testSlapOSCloudUpgradeSlapInterfaceWorkflow
\ No newline at end of file
master/bt5/slapos_pdm/bt/template_workflow_id_list
View file @
4eeac9b7
upgrade_decision_workflow
upgrade_decision_workflow
\ No newline at end of file
upgrade_slap_interface_workflow
\ No newline at end of file
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