Commit 99c8d5ff authored by Romain Courteaud's avatar Romain Courteaud

Computer should also trigger bang on Slave Partition.

parent 3f7378e6
...@@ -51,18 +51,18 @@ ...@@ -51,18 +51,18 @@
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>computer = state_change[\'object\']\n <value> <string>computer = state_change[\'object\']\n
portal = computer.getPortalObject()\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
try:\n for instance_sql in portal.portal_catalog(\n
packing_list_line = computer_partition.Item_getInstancePackingListLine()\n default_aggregate_uid=computer_partition.getUid(),\n
except ValueError:\n portal_type=["Software Instance", "Slave Instance"],\n
# no need to bang trees without any delivery line\n ):\n
continue\n instance = instance_sql.getObject()\n
if packing_list_line.getResource() == context.getPortalObject().portal_preferences.getPreferredInstanceCleanupResource() and \\\n if instance.getSlapState() in ["start_requested", "stop_requested"]:\n
packing_list_line.getSimulationState() == \'delivered\':\n software_instance.activate().SoftwareInstance_bangAsSelf(\n
continue\n relative_url=software_instance.getRelativeUrl(),\n
software_instance = packing_list_line.getAggregateValue(portal_type=\'Software Instance\')\n reference=software_instance.getReference(), \n
software_instance.activate().SoftwareInstance_bangAsSelf(relative_url=software_instance.getRelativeUrl(),\n comment=state_change.kwargs.get(\'comment\', \'\'))\n
reference=software_instance.getReference(), comment=state_change.kwargs.get(\'comment\', \'\'))\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
......
746 747
\ 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