Commit 2390a527 authored by Romain Courteaud's avatar Romain Courteaud

Close computer capacity scope if there is not more free partition

parent 144358f4
......@@ -119,6 +119,16 @@ if can_allocate:\n
comment = \'Computer capacity limit exceded\'\n
break\n
\n
if can_allocate:\n
result_list = portal.portal_catalog.portal_catalog(\n
parent_uid=computer.getUid(),\n
portal_type=\'Computer Partition\',\n
free_for_request=1,\n
limit=1)\n
if len(result_list) == 0:\n
can_allocate = False\n
comment = \'No free partition left\'\n
\n
new_value = None\n
if can_allocate:\n
if computer.getCapacityScope() == \'close\':\n
......
7
\ No newline at end of file
8
\ No newline at end of file
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