Commit b6834e2d authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: rename Service_getSubscriptionStatus to Item_getSubscriptionStatus

parent 046beb0c
...@@ -8,6 +8,7 @@ open_sale_order_movement_list = portal.portal_catalog( ...@@ -8,6 +8,7 @@ open_sale_order_movement_list = portal.portal_catalog(
validation_state='validated', validation_state='validated',
limit=1 limit=1
) )
context.log("%s %s" % (service.getRelativeUrl(), len(open_sale_order_movement_list)))
if len(open_sale_order_movement_list) == 0: if len(open_sale_order_movement_list) == 0:
return "not_subscribed" return "not_subscribed"
......
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>Service_getSubscriptionStatus</string> </value> <value> <string>Item_getSubscriptionStatus</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -195,8 +195,7 @@ for compute_partition_candidate in portal.portal_catalog( ...@@ -195,8 +195,7 @@ for compute_partition_candidate in portal.portal_catalog(
compute_node = compute_partition_candidate.getParentValue() compute_node = compute_partition_candidate.getParentValue()
if compute_node.getPortalType() == 'Compute Node': if compute_node.getPortalType() == 'Compute Node':
subscription_state = compute_node.Service_getSubscriptionStatus() subscription_state = compute_node.Item_getSubscriptionStatus()
compute_node.log('subscription_state for Compute Node %s: %s' % (compute_node.getRelativeUrl(), subscription_state))
if subscription_state in ('not_subscribed', 'nopaid'): if subscription_state in ('not_subscribed', 'nopaid'):
continue continue
elif subscription_state in ('subscribed', 'todestroy'): elif subscription_state in ('subscribed', 'todestroy'):
......
...@@ -600,7 +600,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin): ...@@ -600,7 +600,7 @@ class SlapOSTestCaseMixin(testSlapOSMixin):
url_string='type%s' % self.generateNewId(), url_string='type%s' % self.generateNewId(),
) )
@simulate('Service_getSubscriptionStatus', '*args, **kwargs', 'return "subscribed"') @simulate('Item_getSubscriptionStatus', '*args, **kwargs', 'return "subscribed"')
def bootstrapAllocableInstanceTree(self, allocation_state='possible', shared=False, node="compute", def bootstrapAllocableInstanceTree(self, allocation_state='possible', shared=False, node="compute",
is_accountable=False, base_price=None, has_organisation=False): is_accountable=False, base_price=None, has_organisation=False):
if allocation_state not in ('impossible', 'possible', 'allocated'): if allocation_state not in ('impossible', 'possible', 'allocated'):
......
...@@ -28,7 +28,7 @@ if requester_instance.getPortalType() == "Instance Tree": ...@@ -28,7 +28,7 @@ if requester_instance.getPortalType() == "Instance Tree":
# Do not propagate instante tree changes if current user # Do not propagate instante tree changes if current user
# subscription status is not OK # subscription status is not OK
subscription_state = instance_tree.Service_getSubscriptionStatus() subscription_state = instance_tree.Item_getSubscriptionStatus()
if subscription_state in ('not_subscribed', 'nopaid'): if subscription_state in ('not_subscribed', 'nopaid'):
context.REQUEST.set('request_instance', None) context.REQUEST.set('request_instance', None)
return return
......
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