Commit eee63a74 authored by Alain Takoudjou's avatar Alain Takoudjou Committed by Rafael Monnerat

Rename HostingSubscription_checkSofwareInstanceState, set alarm period to 30 minutes

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