Commit fb37a15e authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Just a script to handle project_guid for now

parent 31ca6307
...@@ -36,12 +36,10 @@ if 'project_guid' in filter_kw: ...@@ -36,12 +36,10 @@ if 'project_guid' in filter_kw:
# Get Computer list from Tracking API # Get Computer list from Tracking API
from DateTime import DateTime from DateTime import DateTime
project = context.portal_catalog(portal_type="Project", refernece=project_reference) project = context.portal_catalog.getResultValue(portal_type="Project", reference=project_reference)
if project is not None: if project is not None:
query_kw["parent_reference"] = SimpleQuery(parent_reference=[i.getReference() query_kw["parent_reference"] = SimpleQuery(parent_reference=project.Project_getComputerReferenceList())
for i in context.portal_simulation.getCurrentTrackingList(
{"project_uid": project.getUid(), "at_date": DateTime()})])
if computer_network_query: if computer_network_query:
if query_kw.get("default_subordination_reference"): if query_kw.get("default_subordination_reference"):
...@@ -91,6 +89,7 @@ if subscription_reference is not None: ...@@ -91,6 +89,7 @@ if subscription_reference is not None:
extra_query_kw = context.ComputerPartition_getCustomAllocationParameterDict( extra_query_kw = context.ComputerPartition_getCustomAllocationParameterDict(
software_release_url, software_type, software_instance_portal_type, software_release_url, software_type, software_instance_portal_type,
filter_kw_copy, computer_network_query, test_mode) filter_kw_copy, computer_network_query, test_mode)
if extra_query_kw: if extra_query_kw:
query_kw.update(extra_query_kw) query_kw.update(extra_query_kw)
...@@ -112,6 +111,7 @@ if offset >= SQL_WINDOW_SIZE: ...@@ -112,6 +111,7 @@ if offset >= SQL_WINDOW_SIZE:
else: else:
limit = (0, SQL_WINDOW_SIZE) limit = (0, SQL_WINDOW_SIZE)
for computer_partition_candidate in context.portal_catalog( for computer_partition_candidate in context.portal_catalog(
limit=limit, **query_kw): limit=limit, **query_kw):
computer_partition_candidate = computer_partition_candidate.getObject() computer_partition_candidate = computer_partition_candidate.getObject()
......
from DateTime import DateTime
from zExceptions import Unauthorized
if REQUEST is not None:
raise Unauthorized
return [i.getReference()
for i in context.portal_simulation.getCurrentTrackingList(
**{"project_uid": context.getUid(), "at_date": DateTime()})]
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</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>REQUEST=None</string> </value>
</item>
<item>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Project_getComputerReferenceList</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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