Commit 34f77dd9 authored by Romain Courteaud's avatar Romain Courteaud

Fix selection tester destruction alarm.

parent f4284076
...@@ -65,6 +65,7 @@ setup_service = portal.restrictedTraverse(portal.portal_preferences.getPreferred ...@@ -65,6 +65,7 @@ setup_service = portal.restrictedTraverse(portal.portal_preferences.getPreferred
portal.portal_catalog.searchAndActivate(\n portal.portal_catalog.searchAndActivate(\n
portal_type="Hosting Subscription",\n portal_type="Hosting Subscription",\n
owner=person_reference,\n owner=person_reference,\n
validation_state="validated",\n
method_id=\'HostingSubcription_requestDestructionSeleniumTester\',\n method_id=\'HostingSubcription_requestDestructionSeleniumTester\',\n
method_kw={\'tag\': tag},\n method_kw={\'tag\': tag},\n
activate_kw={\'tag\': tag},\n activate_kw={\'tag\': tag},\n
......
...@@ -58,10 +58,18 @@ hosting_subscription = context\n ...@@ -58,10 +58,18 @@ hosting_subscription = context\n
\n \n
now = DateTime()\n now = DateTime()\n
\n \n
if hosting_subscription.getAggregateRelatedValue(portal_type=\'Sale Order Line\').getParentValue().getDestinationSectionValue().getReference() == \'seleniumtester\' and \\\n if hosting_subscription.getDestinationSectionValue().getReference() == \'seleniumtester\' and \\\n
hosting_subscription.getModificationDate() < (now - 1):\n hosting_subscription.getModificationDate() < (now - 1):\n
if hosting_subscription.SoftwareInstance_getStatus() not in [\'Destroyed\', \'Destruction in progress\']:\n if hosting_subscription.getSlapState() != "destroy_requested":\n
hosting_subscription.requestDestroy(comment=\'Requested by clenaup alarm\', activate_kw={\'tag\': tag})\n hosting_subscription.requestDestroy(\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
comment=\'Requested by clenaup alarm\', \n
activate_kw={\'tag\': tag}\n
)\n
]]></string> </value> ]]></string> </value>
......
764 765
\ 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