Commit fb5cb236 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Don't make normal allocations on subscriptions only computers

parent c1eb0086
import random import random
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, ComplexQuery from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, ComplexQuery, NegatedQuery
person = context person = context
computer_partition = None computer_partition = None
...@@ -85,6 +85,10 @@ query_kw["capacity_scope_uid"] = context.getPortalObject().portal_categories.cap ...@@ -85,6 +85,10 @@ query_kw["capacity_scope_uid"] = context.getPortalObject().portal_categories.cap
if subscription_reference is not None: if subscription_reference is not None:
# Subscriptions uses a specific set of allocation scope # Subscriptions uses a specific set of allocation scope
query_kw["allocation_scope_uid"] = context.getPortalObject().portal_categories.allocation_scope.open.subscription.getUid() query_kw["allocation_scope_uid"] = context.getPortalObject().portal_categories.allocation_scope.open.subscription.getUid()
else:
# else pic anything but open/subscription
query_kw["allocation_scope_uid"] = NegatedQuery(SimpleQuery(allocation_scope_uid=context.getPortalObject().portal_categories.allocation_scope.open.subscription.getUid()))
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,
......
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