Commit 1e9ba84a authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: source_administration is not used anymore on Compute Node

parent e86ce65b
......@@ -16,10 +16,6 @@ try:
except KeyError:
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)
if (portal.portal_activities.countMessageWithTag(tag) > 0):
......@@ -37,9 +33,6 @@ resource_value = compute_node.Item_getResourceValue()
if destination_project is None and source_project is not None:
destination_project = source_project.getRelativeUrl()
if destination_section is None:
destination_section = compute_node.getSourceAdministration()
if destination is None and source is not None:
# We do not change location of the machine
destination = source.getRelativeUrl()
......@@ -47,9 +40,6 @@ if destination is None and source is not None:
if source is None and destination is None:
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
module = portal.getDefaultModule(portal_type=movement_portal_type)
......
......@@ -7,10 +7,6 @@ portal = computer_network.getPortalObject()
# Get required arguments
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
# Raise TypeError if all parameters are not provided
try:
......@@ -30,16 +26,11 @@ movement_portal_type = "Internal Packing List"
source_project = computer_network.Item_getCurrentProjectValue()
source_section = computer_network.Item_getCurrentOwnerValue()
source = computer_network.getSourceAdministration()
destination = computer_network.getSourceAdministration()
resource_value = portal.product_module.compute_node
if destination_project is None and source_project is not None:
destination_project = source_project.getRelativeUrl()
if source_section is None:
source_section = computer_network.getSourceAdministrationValue()
if destination_section is None:
destination_section = source_section.getRelativeUrl()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment