Commit 8605c74c authored by Łukasz Nowak's avatar Łukasz Nowak

Ignore busy partitions w/o deliveries.

Sysadmins may mark partition busy in order to lock the down.
parent f396d27f
...@@ -52,8 +52,11 @@ ...@@ -52,8 +52,11 @@
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>computer = state_change[\'object\']\n <value> <string>computer = state_change[\'object\']\n
for computer_partition in [x for x in computer.contentValues(portal_type=\'Computer Partition\') if x.getSlapState() == \'busy\']:\n for computer_partition in [x for x in computer.contentValues(portal_type=\'Computer Partition\') if x.getSlapState() == \'busy\']:\n
# raises ValueError in case of no packing list found, left as is\n try:\n
packing_list_line = computer_partition.Item_getInstancePackingListLine()\n packing_list_line = computer_partition.Item_getInstancePackingListLine()\n
except ValueError:\n
# no need to bang trees without any delivery line\n
continue\n
software_instance = packing_list_line.getAggregateValue(portal_type=\'Software Instance\')\n software_instance = packing_list_line.getAggregateValue(portal_type=\'Software Instance\')\n
software_instance.activate().SoftwareInstance_bangAsSelf(reference=software_instance.getReference(),\n software_instance.activate().SoftwareInstance_bangAsSelf(reference=software_instance.getReference(),\n
comment=state_change.kwargs.get(\'comment\', \'\'))\n comment=state_change.kwargs.get(\'comment\', \'\'))\n
......
485 486
\ No newline at end of file \ 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