Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
2c6547c0
Commit
2c6547c0
authored
Jun 15, 2022
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: drop transfer from another Project
parent
9c8dfe65
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
0 additions
and
244 deletions
+0
-244
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/script_RequesterInstance_requestTransfer.py
...face_workflow/script_RequesterInstance_requestTransfer.py
+0
-85
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/script_RequesterInstance_requestTransfer.xml
...ace_workflow/script_RequesterInstance_requestTransfer.xml
+0
-87
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/state_destroy_requested.xml
...tance_slap_interface_workflow/state_destroy_requested.xml
+0
-1
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/state_draft.xml
...workflow/instance_slap_interface_workflow/state_draft.xml
+0
-1
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/state_start_requested.xml
...nstance_slap_interface_workflow/state_start_requested.xml
+0
-1
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/state_stop_requested.xml
...instance_slap_interface_workflow/state_stop_requested.xml
+0
-1
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/transition_request_transfer.xml
...e_slap_interface_workflow/transition_request_transfer.xml
+0
-68
No files found.
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/script_RequesterInstance_requestTransfer.py
deleted
100644 → 0
View file @
9c8dfe65
requester_instance
=
state_change
[
'object'
]
portal
=
requester_instance
.
getPortalObject
()
from
zExceptions
import
Unauthorized
from
DateTime
import
DateTime
assert
requester_instance
.
getPortalType
()
==
'Instance Tree'
# Get required arguments
kwargs
=
state_change
.
kwargs
# Required args
# Raise TypeError if all parameters are not provided
try
:
# destination=None, destination_project=None
destination
=
kwargs
[
'destination'
]
destination_project
=
kwargs
[
"destination_project"
]
except
KeyError
:
raise
TypeError
(
"InstanceTree_requestTransfer takes exactly 2 arguments"
)
user
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
if
user
is
None
or
user
.
getRelativeUrl
()
!=
requester_instance
.
getDestinationSection
():
raise
Unauthorized
(
"Only the Instance Tree owner can transfer it from one location to another."
)
tag
=
"%s_%s_%s_inProgress"
%
(
requester_instance
.
getUid
(),
destination
,
destination_project
)
if
(
portal
.
portal_activities
.
countMessageWithTag
(
tag
)
>
0
):
# The software instance is already under creation but can not be fetched from catalog
# As it is not possible to fetch informations, it is better to raise an error
raise
NotImplementedError
(
tag
)
movement_portal_type
=
"Internal Packing List"
source
=
requester_instance
.
Item_getCurrentSiteValue
()
source_project
=
requester_instance
.
Item_getCurrentProjectValue
()
source_section
=
requester_instance
.
Item_getCurrentOwnerValue
()
resource_value
=
requester_instance
.
Item_getResourceValue
()
if
destination_project
is
None
and
source_project
is
not
None
:
destination_project
=
source_project
.
getRelativeUrl
()
destination_section
=
requester_instance
.
getDestinationSection
()
if
source_section
is
None
:
source_section
=
requester_instance
.
getDestinationSectionValue
()
if
destination
is
None
and
source
is
not
None
:
destination
=
source
.
getRelativeUrl
()
resource_value
=
requester_instance
.
product_module
.
compute_node
module
=
portal
.
getDefaultModule
(
portal_type
=
movement_portal_type
)
line_portal_type
=
'%s Line'
%
movement_portal_type
delivery
=
module
.
newContent
(
title
=
"Transfer %s to %s"
%
(
requester_instance
.
getTitle
(),
destination_project
),
source_value
=
source
,
source_section_value
=
source_section
,
source_project_value
=
source_project
,
destination
=
destination
,
destination_section
=
destination_section
,
source_decision
=
destination_section
,
destination_decision
=
destination_section
,
destination_project_value
=
destination_project
,
start_date
=
DateTime
(),
stop_date
=
DateTime
(),
portal_type
=
movement_portal_type
)
delivery_line
=
delivery
.
newContent
(
portal_type
=
line_portal_type
,
title
=
requester_instance
.
getReference
(),
quantity_unit
=
requester_instance
.
getQuantityUnit
(),
resource_value
=
resource_value
)
delivery_line
.
edit
(
price
=
0.0
,
quantity
=
1.0
,
aggregate_value
=
requester_instance
)
delivery
.
confirm
()
delivery
.
stop
()
delivery
.
deliver
()
delivery
.
reindexObject
(
activate_kw
=
dict
(
tag
=
tag
))
delivery_line
.
reindexObject
(
activate_kw
=
dict
(
tag
=
tag
))
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/script_RequesterInstance_requestTransfer.xml
deleted
100644 → 0
View file @
9c8dfe65
<?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>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</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>
<string>
Owner
</string>
</tuple>
</value>
</item>
<item>
<key>
<string>
description
</string>
</key>
<value>
<none/>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
script_RequesterInstance_requestTransfer
</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>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/state_destroy_requested.xml
View file @
2c6547c0
...
...
@@ -20,7 +20,6 @@
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_generate_certificate
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_report_compute_partition_error
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_request_instance
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_request_transfer
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_revoke_certificate
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_unallocate_partition
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_update_connection
</string>
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/state_draft.xml
View file @
2c6547c0
...
...
@@ -20,7 +20,6 @@
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_generate_certificate
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_request_start
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_request_stop
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_request_transfer
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_revoke_certificate
</string>
</tuple>
</value>
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/state_start_requested.xml
View file @
2c6547c0
...
...
@@ -25,7 +25,6 @@
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_request_instance
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_request_start
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_request_stop
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_request_transfer
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_revoke_certificate
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_update_connection
</string>
</tuple>
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/state_stop_requested.xml
View file @
2c6547c0
...
...
@@ -25,7 +25,6 @@
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_request_instance
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_request_start
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_request_stop
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_request_transfer
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_revoke_certificate
</string>
<string>
destination/portal_workflow/instance_slap_interface_workflow/transition_update_connection
</string>
</tuple>
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/instance_slap_interface_workflow/transition_request_transfer.xml
deleted
100644 → 0
View file @
9c8dfe65
<?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/instance_slap_interface_workflow/script_Instance_checkConsistency
</string>
<string>
after_script/portal_workflow/instance_slap_interface_workflow/script_RequesterInstance_requestTransfer
</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_request_transfer
</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 Transfer
</string>
</value>
</item>
<item>
<key>
<string>
trigger_type
</string>
</key>
<value>
<int>
2
</int>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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