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

Computer should also trigger bang on Slave Partition.

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