Commit 86038e90 authored by Alain Takoudjou's avatar Alain Takoudjou

slapos_cloud: do not consider subscription allocation scope while requesting slave instances

Instances with subscription request can also request Slave Instances for frontends and others on shared computers.
parent ef0849c6
import random import random
from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, ComplexQuery, NegatedQuery from Products.ZSQLCatalog.SQLCatalog import SimpleQuery, ComplexQuery
person = context person = context
portal = context.getPortalObject() portal = context.getPortalObject()
...@@ -88,7 +88,7 @@ for base_category in computer_base_category_list: ...@@ -88,7 +88,7 @@ for base_category in computer_base_category_list:
query_kw["%s_uid" % base_category] = category.getUid() query_kw["%s_uid" % base_category] = category.getUid()
query_kw["capacity_scope_uid"] = portal.portal_categories.capacity_scope.open.getUid() query_kw["capacity_scope_uid"] = portal.portal_categories.capacity_scope.open.getUid()
if subscription_reference is not None: if subscription_reference is not None and software_instance_portal_type != "Slave Instance":
# Subscriptions uses a specific set of allocation scope # Subscriptions uses a specific set of allocation scope
query_kw["allocation_scope_uid"] = portal.portal_categories.allocation_scope.open.subscription.getUid() query_kw["allocation_scope_uid"] = portal.portal_categories.allocation_scope.open.subscription.getUid()
else: else:
......
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