Commit fabb6c8e authored by Romain Courteaud's avatar Romain Courteaud

Destroy should be done from person.

It allows to propagate the state to the instance.
parent 633c2d13
......@@ -60,13 +60,16 @@ now = DateTime()\n
\n
if hosting_subscription.getDestinationSectionValue().getReference() == \'seleniumtester\' and \\\n
hosting_subscription.getModificationDate() < (now - 1):\n
if hosting_subscription.getSlapState() != "destroy_requested":\n
hosting_subscription.requestDestroy(\n
\n
person = hosting_subscription.getDestinationSectionValue(portal_type="Person")\n
person.requestSoftwareInstance(\n
software_release=hosting_subscription.getRootSoftwareReleaseUrl(),\n
instance_xml=hosting_subscription.getTextContent(),\n
software_type=hosting_subscription.getSourceReference(),\n
sla_xml=hosting_subscription.getSlaXml(),\n
shared=hosting_subscription.getRootSlave(),\n
state="destroyed",\n
software_title=hosting_subscription.getTitle(),\n
comment=\'Requested by clenaup alarm\', \n
activate_kw={\'tag\': tag}\n
)\n
......
770
\ No newline at end of file
771
\ 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