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
Titouan Soulard
slapos.core
Commits
bcc2766a
Commit
bcc2766a
authored
Jun 15, 2022
by
Romain Courteaud
🐙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_cloud: source_administration is not used anymore on Compute Node
parent
64506eed
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
0 additions
and
19 deletions
+0
-19
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/compute_node_slap_interface_workflow/script_ComputeNode_requestTransfer.py
..._interface_workflow/script_ComputeNode_requestTransfer.py
+0
-10
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/network_slap_interface_workflow/script_ComputerNetwork_requestTransfer.py
...erface_workflow/script_ComputerNetwork_requestTransfer.py
+0
-9
No files found.
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/compute_node_slap_interface_workflow/script_ComputeNode_requestTransfer.py
View file @
bcc2766a
...
@@ -16,10 +16,6 @@ try:
...
@@ -16,10 +16,6 @@ try:
except
KeyError
:
except
KeyError
:
raise
TypeError
(
"ComputeNode_requestTransfer takes exactly 3 arguments"
)
raise
TypeError
(
"ComputeNode_requestTransfer takes exactly 3 arguments"
)
user
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
if
user
is
None
or
user
.
getRelativeUrl
()
!=
compute_node
.
getSourceAdministration
():
raise
Unauthorized
(
"Only the compute_node owner can Transfer compute_node from one location to another."
)
tag
=
"%s_%s_%s_%s_inProgress"
%
(
compute_node
.
getUid
(),
destination
,
destination_project
,
destination_section
)
tag
=
"%s_%s_%s_%s_inProgress"
%
(
compute_node
.
getUid
(),
destination
,
destination_project
,
destination_section
)
if
(
portal
.
portal_activities
.
countMessageWithTag
(
tag
)
>
0
):
if
(
portal
.
portal_activities
.
countMessageWithTag
(
tag
)
>
0
):
...
@@ -37,9 +33,6 @@ resource_value = compute_node.Item_getResourceValue()
...
@@ -37,9 +33,6 @@ resource_value = compute_node.Item_getResourceValue()
if
destination_project
is
None
and
source_project
is
not
None
:
if
destination_project
is
None
and
source_project
is
not
None
:
destination_project
=
source_project
.
getRelativeUrl
()
destination_project
=
source_project
.
getRelativeUrl
()
if
destination_section
is
None
:
destination_section
=
compute_node
.
getSourceAdministration
()
if
destination
is
None
and
source
is
not
None
:
if
destination
is
None
and
source
is
not
None
:
# We do not change location of the machine
# We do not change location of the machine
destination
=
source
.
getRelativeUrl
()
destination
=
source
.
getRelativeUrl
()
...
@@ -47,9 +40,6 @@ if destination is None and source is not None:
...
@@ -47,9 +40,6 @@ if destination is None and source is not None:
if
source
is
None
and
destination
is
None
:
if
source
is
None
and
destination
is
None
:
raise
ValueError
(
"Sorry, destination is required for the initial set."
)
raise
ValueError
(
"Sorry, destination is required for the initial set."
)
if
source_section
is
None
:
source_section
=
compute_node
.
getSourceAdministration
()
resource_value
=
portal
.
product_module
.
compute_node
resource_value
=
portal
.
product_module
.
compute_node
module
=
portal
.
getDefaultModule
(
portal_type
=
movement_portal_type
)
module
=
portal
.
getDefaultModule
(
portal_type
=
movement_portal_type
)
...
...
master/bt5/slapos_cloud/WorkflowTemplateItem/portal_workflow/network_slap_interface_workflow/script_ComputerNetwork_requestTransfer.py
View file @
bcc2766a
...
@@ -7,10 +7,6 @@ portal = computer_network.getPortalObject()
...
@@ -7,10 +7,6 @@ portal = computer_network.getPortalObject()
# Get required arguments
# Get required arguments
kwargs
=
state_change
.
kwargs
kwargs
=
state_change
.
kwargs
user
=
portal
.
portal_membership
.
getAuthenticatedMember
().
getUserValue
()
if
user
is
None
or
user
.
getRelativeUrl
()
!=
computer_network
.
getSourceAdministration
():
raise
Unauthorized
(
"Only the Computer Network owner can transfer it from one location to another."
)
# Required args
# Required args
# Raise TypeError if all parameters are not provided
# Raise TypeError if all parameters are not provided
try
:
try
:
...
@@ -30,16 +26,11 @@ movement_portal_type = "Internal Packing List"
...
@@ -30,16 +26,11 @@ movement_portal_type = "Internal Packing List"
source_project
=
computer_network
.
Item_getCurrentProjectValue
()
source_project
=
computer_network
.
Item_getCurrentProjectValue
()
source_section
=
computer_network
.
Item_getCurrentOwnerValue
()
source_section
=
computer_network
.
Item_getCurrentOwnerValue
()
source
=
computer_network
.
getSourceAdministration
()
destination
=
computer_network
.
getSourceAdministration
()
resource_value
=
portal
.
product_module
.
compute_node
resource_value
=
portal
.
product_module
.
compute_node
if
destination_project
is
None
and
source_project
is
not
None
:
if
destination_project
is
None
and
source_project
is
not
None
:
destination_project
=
source_project
.
getRelativeUrl
()
destination_project
=
source_project
.
getRelativeUrl
()
if
source_section
is
None
:
source_section
=
computer_network
.
getSourceAdministrationValue
()
if
destination_section
is
None
:
if
destination_section
is
None
:
destination_section
=
source_section
.
getRelativeUrl
()
destination_section
=
source_section
.
getRelativeUrl
()
...
...
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