Commit e6456daa authored by Antoine Catton's avatar Antoine Catton

Modify HostingSubscription_requestRootSoftwareInstance in order to avoid...

Modify HostingSubscription_requestRootSoftwareInstance in order to avoid starting/stopping a destroyed computer partition.
parent ace62d1f
......@@ -115,12 +115,23 @@ else:\n
sla_xml=context.getSlaXml(),\n
activate_kw={\'tag\': tag},\n
)\n
if context.getRootState() == \'started\':\n
request_software_instance.startRequested()\n
request_software_instance.activate(after_tag=tag).requestStartComputerPartition()\n
elif context.getRootState() == \'stopped\':\n
request_software_instance.stopRequested()\n
request_software_instance.activate(after_tag=tag).requestStopComputerPartition()\n
destroyed = False\n
try:\n
cleanup_delivery_line = request_software_instance.Item_getInstancePackingListLine(\n
portal.portal_preferences.getPreferredInstanceCleanupResource()\n
)\n
if cleanup_delivery_line.getSimulationState() == \'delivered\':\n
destroyed = True\n
except ValueError:\n
pass\n
\n
if not destroyed:\n
if context.getRootState() == \'started\':\n
request_software_instance.startRequested()\n
request_software_instance.activate(after_tag=tag).requestStartComputerPartition()\n
elif context.getRootState() == \'stopped\':\n
request_software_instance.stopRequested()\n
request_software_instance.activate(after_tag=tag).requestStopComputerPartition()\n
\n
return request_software_instance\n
......
455
\ No newline at end of file
456
\ 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