Commit bb80ef79 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_cloud: Don't allocate instances w/o Hosting Subscription

parent 9389ad85
...@@ -18,6 +18,10 @@ def assignComputerPartition(software_instance, hosting_subscription): ...@@ -18,6 +18,10 @@ def assignComputerPartition(software_instance, hosting_subscription):
if computer_partition is None: if computer_partition is None:
hosting_subscription = software_instance.getSpecialiseValue( hosting_subscription = software_instance.getSpecialiseValue(
portal_type='Hosting Subscription') portal_type='Hosting Subscription')
if hosting_subscription is None:
raise ValueError('%s does not have related hosting subscription' % software_instance.getRelativeUrl())
person = hosting_subscription.getDestinationSectionValue(portal_type='Person') person = hosting_subscription.getDestinationSectionValue(portal_type='Person')
if person is None: if person is None:
raise ValueError('%s does not have person related' % hosting_subscription.getRelativeUrl()) raise ValueError('%s does not have person related' % hosting_subscription.getRelativeUrl())
......
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