Commit c07b4e24 authored by Alain Takoudjou's avatar Alain Takoudjou

Merge branch 'master' into operation-control

Conflicts:
	master/bt5/slapos_pdm/bt/revision
parents b9ae3bf1 6a17abcf
...@@ -103,7 +103,7 @@ else:\n ...@@ -103,7 +103,7 @@ else:\n
url_string=software_release_url,\n url_string=software_release_url,\n
aggregate=computer.getRelativeUrl(),\n aggregate=computer.getRelativeUrl(),\n
activate_kw={\'tag\': tag},\n activate_kw={\'tag\': tag},\n
destination_section=portal.ERP5Site_getAuthenticatedMemberPersonValue().getRelativeUrl()\n destination_section=computer.getSourceAdministration()\n
)\n )\n
\n \n
# Change desired state\n # Change desired state\n
......
...@@ -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
......
...@@ -1836,7 +1836,7 @@ class TestSlapOSComputer_notifyWrongAllocationScope(testSlapOSMixin): ...@@ -1836,7 +1836,7 @@ class TestSlapOSComputer_notifyWrongAllocationScope(testSlapOSMixin):
return assignment return assignment
def _getGeneratedSupportRequest(self, computer): def _getGeneratedSupportRequest(self, computer):
request_title = '[MONITORING] Allocation scope has been changed for %s' % \ request_title = '[MONITORING] We have changed allocation scope for %s' % \
computer.getReference() computer.getReference()
support_request = self.portal.portal_catalog.getResultValue( support_request = self.portal.portal_catalog.getResultValue(
portal_type = 'Support Request', portal_type = 'Support Request',
......
44 46
\ No newline at end of file \ No newline at end of file
slapos_crm slapos_crm
\ No newline at end of file slapos_crm_monitoring
\ No newline at end of file
<base_category_list>
<portal_type id="Upgrade Decision">
<item>resource</item>
</portal_type>
</base_category_list>
\ No newline at end of file
...@@ -28,9 +28,7 @@ ...@@ -28,9 +28,7 @@
</item> </item>
<item> <item>
<key> <string>init_script</string> </key> <key> <string>init_script</string> </key>
<value> <value> <string>UpgradeDecision_init</string> </value>
<none/>
</value>
</item> </item>
<item> <item>
<key> <string>permission</string> </key> <key> <string>permission</string> </key>
......
...@@ -81,7 +81,6 @@ ...@@ -81,7 +81,6 @@
<key> <string>right</string> </key> <key> <string>right</string> </key>
<value> <value>
<list> <list>
<string>my_resource_title</string>
<string>my_start_date</string> <string>my_start_date</string>
<string>my_stop_date</string> <string>my_stop_date</string>
</list> </list>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>context.UpgradeDecision_init()\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>UpgradeDecision_afterClone</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># Define Reference from ID provided by portal_ids\n
portal = context.getPortalObject()\n
type_definition = context.getTypeInfo()\n
\n
short_portal_type = type_definition.getShortTitle()\n
if not short_portal_type:\n
short_portal_type = \'\'.join(s for s in type_definition.getId() if s.isupper())\n
\n
id_group = (\'reference\', short_portal_type)\n
default = 1\n
new_id = portal.portal_ids.generateNewId(id_group=id_group, default=default)\n
reference = \'%s-%s\' % (short_portal_type, new_id)\n
\n
context.setReference(reference)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>UpgradeDecision_init</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -80,6 +80,7 @@ ...@@ -80,6 +80,7 @@
<list> <list>
<string>my_title</string> <string>my_title</string>
<string>my_reference</string> <string>my_reference</string>
<string>my_resource_title</string>
</list> </list>
</value> </value>
</item> </item>
...@@ -87,8 +88,9 @@ ...@@ -87,8 +88,9 @@
<key> <string>right</string> </key> <key> <string>right</string> </key>
<value> <value>
<list> <list>
<string>my_source_title</string> <string>my_destination_decision_title</string>
<string>my_destination_title</string> <string>my_destination_section_title</string>
<string>my_source_section_title</string>
<string>my_start_date</string> <string>my_start_date</string>
<string>my_stop_date</string> <string>my_stop_date</string>
<string>my_translated_simulation_state_title</string> <string>my_translated_simulation_state_title</string>
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_destination_title</string> </value> <value> <string>my_destination_decision_title</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ProxyField" module="Products.ERP5Form.ProxyField"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>delegated_list</string> </key>
<value>
<list>
<string>title</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_destination_section_title</string> </value>
</item>
<item>
<key> <string>message_values</string> </key>
<value>
<dictionary>
<item>
<key> <string>external_validator_failed</string> </key>
<value> <string>The input failed the external validator.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_destination_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewTradeFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Client</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>my_source_title</string> </value> <value> <string>my_source_section_title</string> </value>
</item> </item>
<item> <item>
<key> <string>message_values</string> </key> <key> <string>message_values</string> </key>
......
...@@ -100,6 +100,7 @@ ...@@ -100,6 +100,7 @@
<string>Assignee</string> <string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Associate</string> <string>Associate</string>
<string>Auditor</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
......
...@@ -34,6 +34,10 @@ ...@@ -34,6 +34,10 @@
<string>confirm_action</string> <string>confirm_action</string>
<string>delete</string> <string>delete</string>
<string>delete_action</string> <string>delete_action</string>
<string>plan</string>
<string>plan_action</string>
<string>start</string>
<string>start_action</string>
</tuple> </tuple>
</value> </value>
</item> </item>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="StateDefinition" module="Products.DCWorkflow.States"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>planned</string> </value>
</item>
<item>
<key> <string>permission_roles</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>transitions</string> </key>
<value>
<tuple>
<string>cancel</string>
<string>cancel_action</string>
<string>confirm</string>
<string>confirm_action</string>
<string>reject</string>
<string>reject_action</string>
<string>start</string>
<string>start_action</string>
</tuple>
</value>
</item>
<item>
<key> <string>type_list</string> </key>
<value>
<tuple/>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>Access contents information</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Add portal content</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Delete objects</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>Modify portal content</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
</tuple>
</value>
</item>
<item>
<key> <string>View</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
</tuple>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
...@@ -72,9 +72,7 @@ ...@@ -72,9 +72,7 @@
<key> <string>Add portal content</string> </key> <key> <string>Add portal content</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Associate</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
...@@ -83,9 +81,7 @@ ...@@ -83,9 +81,7 @@
<key> <string>Delete objects</string> </key> <key> <string>Delete objects</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Associate</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
...@@ -94,9 +90,7 @@ ...@@ -94,9 +90,7 @@
<key> <string>Modify portal content</string> </key> <key> <string>Modify portal content</string> </key>
<value> <value>
<tuple> <tuple>
<string>Assignee</string>
<string>Assignor</string> <string>Assignor</string>
<string>Associate</string>
<string>Manager</string> <string>Manager</string>
</tuple> </tuple>
</value> </value>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>plan</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string>planned</string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Plan Decision</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string>Plan Decision</string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string>%(content_url)s/Base_viewWorkflowActionDialog?workflow_action=plan_action</string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string>plan</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>plan_action</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Plan Action Decision</string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>1</int> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Upgrade Decision | resource
\ 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