Commit 821e9f13 authored by Cédric Le Ninivin's avatar Cédric Le Ninivin

slapos_jio_api_style: Add Compute Node in get Object From Data

parent 2b24e598
...@@ -9,6 +9,18 @@ if portal_type == "Software Installation": ...@@ -9,6 +9,18 @@ if portal_type == "Software Installation":
if compute_node: if compute_node:
return compute_node.getSoftwareInstallationFromUrl(data_dict["software_release_uri"]) return compute_node.getSoftwareInstallationFromUrl(data_dict["software_release_uri"])
elif portal_type == "Compute Node":
if "compute_node_id" in data_dict:
compute_node_id = data_dict["compute_node_id"]
user = portal.portal_membership.getAuthenticatedMember().getUserName()
if str(user) == compute_node_id:
compute_node = portal.portal_membership.getAuthenticatedMember().getUserValue()
compute_node.setAccessStatus(compute_node_id)
else:
compute_node = portal.portal_catalog.getComputeNodeObject(compute_node_id)
if compute_node:
return compute_node
elif portal_type == "Software Instance": elif portal_type == "Software Instance":
if "reference" in data_dict: if "reference" in data_dict:
software_instance = portal.portal_catalog.getSoftwareInstanceObject( software_instance = portal.portal_catalog.getSoftwareInstanceObject(
......
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