Commit 9f176de1 authored by Łukasz Nowak's avatar Łukasz Nowak

Support manual and automatic runs.

It is nice to see error messages w/o swallowing exceptions while running
manually.
parent 498bfa5c
......@@ -60,6 +60,7 @@ portal.portal_catalog.searchAndActivate(\n
left_join_list=select_dict.keys(),\n
\n
method_id=\'SoftwareInstance_tryToAllocatePartition\',\n
method_kw={\'manual\': False},\n
packet_size=1, # Separate calls to many transactions\n
activate_kw={\'tag\': tag}\n
)\n
......
......@@ -92,9 +92,13 @@ if software_instance.getValidationState() != \'validated\' \\\n
try:\n
computer_partition_url = assignComputerPartition(software_instance)\n
except ValueError:\n
if manual:\n
raise\n
# It was not possible to find free Computer Partition\n
markHistory(software_instance, \'Allocation failed: no free Computer Partition\')\n
except Unauthorized, e:\n
if manual:\n
raise\n
# user has bad balance\n
markHistory(software_instance, \'Allocation failed: %s\' % e)\n
else:\n
......@@ -102,6 +106,8 @@ else:\n
try:\n
software_instance.Base_checkConsistency()\n
except ValidationFailed:\n
if manual:\n
raise\n
# order not ready yet\n
markHistory(software_instance, \'Allocation failed: consistency failed\')\n
else:\n
......@@ -110,7 +116,7 @@ else:\n
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>manual=True</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
110
\ No newline at end of file
111
\ 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