Commit 945e47cb authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Rafael Monnerat

Rename HostingSubscription_checkSofwareInstanceState, set alarm period to 30 minutes

parent 3e25c3f6
......@@ -26,13 +26,15 @@
<key> <string>periodicity_hour</string> </key>
<value>
<tuple>
<int>1</int>
<int>0</int>
</tuple>
</value>
</item>
<item>
<key> <string>periodicity_hour_frequency</string> </key>
<value> <int>1</int> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>periodicity_minute</string> </key>
......@@ -44,9 +46,7 @@
</item>
<item>
<key> <string>periodicity_minute_frequency</string> </key>
<value>
<none/>
</value>
<value> <int>30</int> </value>
</item>
<item>
<key> <string>periodicity_month</string> </key>
......
......@@ -63,20 +63,21 @@ software_instance_list = context.portal_catalog(\n
# XXX slap_state=["start_requested", "stop_requested"],\n
default_aggregate_uid=None,\n
select_dict=select_dict,\n
left_join_list=select_dict.keys()\n
left_join_list=select_dict.keys(),\n
group_by="specialise_uid"\n
)\n
\n
#Get the list of concerned Hosting Subscription reference\n
hs_reference_list = set([si.getSpecialiseReference() for si in software_instance_list \n
hs_reference_list = [si.getSpecialiseReference() for si in software_instance_list \n
if si.getSlapState() in [\'start_requested\', \'stop_requested\']\n
])\n
]\n
\n
if len(hs_reference_list) > 0:\n
portal.portal_catalog.searchAndActivate(\n
portal_type=\'Hosting Subscription\',\n
validation_state=\'validated\',\n
reference=hs_reference_list,\n
method_id=\'HostingSubscription_checkSofwareInstanceState\',\n
method_id=\'HostingSubscription_checkSofwareInstanceAllocationState\',\n
activate_kw = {\'tag\':tag}\n
)\n
\n
......
......@@ -88,11 +88,10 @@ for instance in software_instance_list:\n
\n
if has_unallocated_instance and has_newest_allocated_instance:\n
return context.Base_generateSupportRequestForSlapOS(\n
"Hosting Subscription %s (%s) is partially allocated" % (hs_title,\n
hosting_subscription.getReference()),\n
"%s has allocated instance(s) but, instance %s (%s) has been unallocated for more than 4 hours." % (\n
"Hosting Subscription %s is partially allocated" % hs_title,\n
"%s has allocated instance(s) but, the instance %s (%s) has been unallocated for more than 4 hours." % (\n
hs_title, failing_instance.getTitle(), failing_instance.getAbsoluteUrl()),\n
source_instance.getRelativeUrl())\n
hosting_subscription.getRelativeUrl())\n
else:\n
return\n
......@@ -105,7 +104,7 @@ else:\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>HostingSubscription_checkSofwareInstanceState</string> </value>
<value> <string>HostingSubscription_checkSofwareInstanceAllocationState</string> </value>
</item>
</dictionary>
</pickle>
......
38
\ No newline at end of file
39
\ 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