Commit dffd05c7 authored by Rafael Monnerat's avatar Rafael Monnerat

slapos_crm: Split skin folder in 2 for better organisation

slapos_crm_monitoring is the place to include alarms that search/adjust annomalies (ie.: Lack of contact, bad allocation definition ....)
parent 1f835cba
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/> <global name="ERP5 Form" module="erp5.portal_type"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Folder" module="OFS.Folder"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_local_properties</string> </key>
<value>
<tuple>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>business_template_skin_layer_priority</string> </value>
</item>
<item>
<key> <string>type</string> </key>
<value> <string>float</string> </value>
</item>
</dictionary>
</tuple>
</value>
</item>
<item>
<key> <string>_objects</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>business_template_skin_layer_priority</string> </key>
<value> <float>61.0</float> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>slapos_crm_monitoring</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -67,7 +67,7 @@ software_instance_list = context.portal_catalog(\n ...@@ -67,7 +67,7 @@ software_instance_list = context.portal_catalog(\n
group_by="specialise_uid"\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 = [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
......
...@@ -57,8 +57,7 @@ portal = context.getPortalObject()\n ...@@ -57,8 +57,7 @@ portal = context.getPortalObject()\n
allocation_scope = computer.getAllocationScope()\n allocation_scope = computer.getAllocationScope()\n
computer_reference = computer.getReference()\n computer_reference = computer.getReference()\n
\n \n
if allocation_scope != \'open/public\' and \\\n if allocation_scope not in [\'open/public\', \'open/friend\']:\n
allocation_scope != \'open/friend\':\n
return\n return\n
\n \n
is_service_provider = False\n is_service_provider = False\n
...@@ -80,7 +79,7 @@ if not is_service_provider:\n ...@@ -80,7 +79,7 @@ if not is_service_provider:\n
\n \n
# Create a ticket (or re-open it) for this issue!\n # Create a ticket (or re-open it) for this issue!\n
support_request = None\n support_request = None\n
request_title = \'[MONITORING] Allocation scope has been changed for %s\' % computer_reference\n request_title = \'We have changed allocation scope for %s\' % computer_reference\n
request_description = \'Allocation scope has been changed back to \' \\\n request_description = \'Allocation scope has been changed back to \' \\\n
\'open/personal for %s\' % computer_reference\n \'open/personal for %s\' % computer_reference\n
\n \n
...@@ -106,26 +105,19 @@ if not is_service_provider:\n ...@@ -106,26 +105,19 @@ if not is_service_provider:\n
return\n return\n
\n \n
# Send notification message\n # Send notification message\n
message_title = \'We have changed allocation scope for %s\' % computer_reference\n
notification_reference = \'slapos-crm-computer_allocation_scope.notification\'\n
notification_message = portal.portal_notifications.getDocumentValue(\n notification_message = portal.portal_notifications.getDocumentValue(\n
reference=notification_reference)\n reference=\'slapos-crm-computer_allocation_scope.notification\')\n
if notification_message is None:\n
message = """Dear user,\n
%s.\n
Do not hesitate to visit the web forum (http://community.slapos.org/forum) in case of question.\n
\n \n
Regards,\n if notification_message is not None:\n
\n
The slapos team""" % request_description\n
else:\n
mapping_dict = {\'computer_title\':computer.getTitle(),\n mapping_dict = {\'computer_title\':computer.getTitle(),\n
\'computer_id\':computer_reference,\n \'computer_id\':computer_reference,\n
\'allocation_scope\':allocation_scope}\n \'allocation_scope\':allocation_scope}\n
message = notification_message.asText(\n message = notification_message.asText(\n
substitution_method_parameter_dict={\'mapping_dict\':mapping_dict})\n substitution_method_parameter_dict={\'mapping_dict\':mapping_dict})\n
\n else:\n
support_request.SupportRequest_trySendNotificationMessage(message_title,\n message = request_description\n
\n
support_request.SupportRequest_trySendNotificationMessage(request_title,\n
message, person.getRelativeUrl())\n message, person.getRelativeUrl())\n
</string> </value> </string> </value>
</item> </item>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<ZopeData> <ZopeData>
<record id="1" aka="AAAAAAAAAAE="> <record id="1" aka="AAAAAAAAAAE=">
<pickle> <pickle>
<global name="ERP5Form" module="Products.ERP5Form.Form"/> <global name="ERP5 Form" module="erp5.portal_type"/>
</pickle> </pickle>
<pickle> <pickle>
<dictionary> <dictionary>
......
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
support_request = context\n support_request = context\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
\n \n
ressource = portal.service_module.slapos_crm_information.getRelativeUrl()\n resource = portal.service_module.slapos_crm_information.getRelativeUrl()\n
# create Web message if needed for this ticket\n # create Web message if needed for this ticket\n
last_event = context.portal_catalog.getResultValue(\n last_event = context.portal_catalog.getResultValue(\n
follow_up_uid=support_request.getUid(), \n follow_up_uid=support_request.getUid(), \n
...@@ -71,7 +71,7 @@ event.edit(\n ...@@ -71,7 +71,7 @@ event.edit(\n
title=message_title,\n title=message_title,\n
text_content=message,\n text_content=message,\n
start_date = DateTime(),\n start_date = DateTime(),\n
resource = ressource,\n resource = resource,\n
source=source_relative_url,\n source=source_relative_url,\n
follow_up=support_request.getRelativeUrl(),\n follow_up=support_request.getRelativeUrl(),\n
)\n )\n
......
44 45
\ No newline at end of file \ No newline at end of file
slapos_crm slapos_crm
slapos_crm_monitoring
\ 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