Commit c9641b8f authored by Romain Courteaud's avatar Romain Courteaud

slapos_subscription_request: do not accept new services if the virtual master...

slapos_subscription_request: do not accept new services if the virtual master subscription state is not expected
parent 3791a268
......@@ -8,6 +8,15 @@ if item is None:
# Use list setter, to ensure it crashes if item is still None
# subscription_request.setAggregateValueList([item])
# If the virtual master is not in the expected subscription status,
# do not accept any new service (compute node, instance) for it
if (((subscription_request.getSourceProjectValue() is not None) and
(subscription_request.getSourceProjectValue().Item_getSubscriptionStatus() != 'subscribed')) or
((subscription_request.getDestinationProjectValue() is not None) and
(subscription_request.getDestinationProjectValue().Item_getSubscriptionStatus() != 'subscribed'))):
return
# Accept the subscription only if user paid the security payment
if (subscription_request.getSourceValue() is None) or \
(subscription_request.getSource() != subscription_request.getDestination()):
......
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