Commit d40d2e21 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: do not allocate on a Compute Node without any Subscription

parent 025245dd
......@@ -197,6 +197,15 @@ for compute_partition_candidate in portal.portal_catalog(
# The compute_node was closed on this partition, so skip it.
continue
compute_node = compute_partition_candidate.getParentValue()
if compute_node.getPortalType() == 'Compute Node':
subscription_state = compute_node.Service_getSubscriptionStatus()
compute_node.log('subscription_state for Compute Node %s: %s' % (compute_node.getRelativeUrl(), subscription_state))
if subscription_state in ('not_subscribed', 'nopaid'):
continue
elif subscription_state in ('subscribed', 'todestroy'):
pass
if software_instance_portal_type == "Software Instance":
# Check if the compute partition can be marked as busy
if isTransitionPossible(compute_partition_candidate, 'mark_busy'):
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>instance_tree, project_uid, software_release_url, software_type, software_instance_portal_type, filter_kw, computer_network_query=None, subscription_reference=None, test_mode=False</string> </value>
<value> <string>instance_tree, project_uid, software_release_url, software_type, software_instance_portal_type, filter_kw, computer_network_query=None, test_mode=False</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
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