Commit 7c761994 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud:

* drop support request template preference
* drop my_preferred_support_request_template
* stop using getPreferredSupportRequestTemplate
* drop Subscription Condition usage
* break Base_getSupportRequestInProgress
  Use causality category instead of aggregate, to link the Ticket to the context document (instance, node, ...).
  Aggregate must be used to define the item of the movement resource.
  Break the parameters and use the context to define the causality value.
* use causality to link the  Ticket to the context document
* XXX disable person.notify & person.requestSupport
  I don't get why there are 2 transitions for now.
* drop ComputerNetwork_viewComputeNodeList
* drop notify and requestSupport transitions
  They have been replaced by python script and alarms
* test: person.notify has been dropped
* drop slapos_crm_regularisation_request_template
* Do not allow user to change the release/type/shared status
* no need to use a tag if context is not reindexed
* allow to force software change
* speed up Base_reindexAndSenseAlarm execution
* drop my_preferred_default_pre_payment_template
* drop default_pre_payment_subscription_invoice_template
* drop getPreferredAggregatedSubscriptionSaleTradeCondition
* test: drop unused functions
* drop preferred_aggregated_sale_trade_condition
* drop preferred_aggregated_sale_trade_condition
* test: drop reference to slapos_aggregated_trade_condition_v3
* test: drop test from dropped interaction
* test: role is not required on a Person
* test: do not invalidate instance to not unlink
* test: create Trade Condition when Project is accountable
* drop slapos_crm_web_message_template
* drop my_preferred_web_message_template
* drop template_pre_payment_subscription_sale_invoice_transaction
* drop preferred_default_pre_payment_subscription_invoice_template
* drop slapos_accounting_instance_delivery_line_template
* drop slapos_aggregated_consumption_trade_condition
* drop preferred_aggregated_consumption_sale_trade_condition
* drop unused template
* drop template_computer_model
* drop template_hosting_subscription
* drop template_software_installation
* drop template_compute_node
* drop template_instance_tree
* drop template_software_instance
* drop template_member
* drop drop template_software_instance
* drop template_software_instance
* drop template_software_instance
* add afterClone scripts
* test: check remote node parameters propagation
* try to create an upgrade decision for a remote instance
* test: add checkRemoteInstanceUnallocation method
* XXX stop invalidating Slave Instance
  TODO: Instance on Remote Node must propagate their destruction, before being invalidated
* instance must be invalidated before unallocating it
* drop not needed script
* invalidate Slave Instance allocation on a Compute Node
* trigger invalidation as soon as an Instance is destroyed
* alarm must visit allocated Slave Instance to invalidate them
* report software url of the linked instance, even if it is in destroyed_state / invalidated
* test: slave are not directly invalidated as soon as it is destroyed
* propagate remote node destruction
* do not crash if no instance is found
* ExactMatch
* drop comments
* keep compatibility with project_guid sla
* allow to propagate a single instance
* add subordination category on Remote Node
* try to wait for previous alarms to finish before triggering a new one
* priority 3
* do not call activeSense concurrently
* prevent activeSense to be called concurrently
* reduce number of activities
* do not loop
* drop preferred_cloud_contract_enabled
* stop using hateoas web site
* change the skin selection to register
* test: create needed bank account
parent b8ae0c1c
<module>
<category_list>
<category>business_application/slapos</category>
</category_list>
<id>allocation_supply_module</id>
<permission_list>
<permission type='tuple'>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Compute Node" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_compute_node</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Compute Node</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Computer Model" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>capacity_quantity</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_computer_model</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Computer Model</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>template_computer_model</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Hosting Subscription" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_hosting_subscription</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>periodicity_hour</string> </key>
<value>
<tuple>
<int>0</int>
</tuple>
</value>
</item>
<item>
<key> <string>periodicity_minute</string> </key>
<value>
<tuple>
<int>0</int>
</tuple>
</value>
</item>
<item>
<key> <string>periodicity_month_day</string> </key>
<value>
<tuple>
<int>17</int>
</tuple>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Hosting Subscription</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Instance Tree" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>RootSoftwareInstance</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_instance_tree</string> </value>
</item>
<item>
<key> <string>language</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>periodicity_hour</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_minute</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_month</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_month_day</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>periodicity_week</string> </key>
<value>
<tuple/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Instance Tree</string> </value>
</item>
<item>
<key> <string>root_slave</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>sla_xml</string> </key>
<value> <string encoding="cdata"><![CDATA[
<?xml version=\'1.0\' encoding=\'utf-8\'?>\n
<instance>\n
<parameter id="computer_guid">SOMECOMP</parameter>\n
</instance>\n
]]></string> </value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
<?xml version="1.0" encoding="utf-8"?>\n
<instance>\n
<parameter id="parameter1">valueof1</parameter>\n
<parameter id="parameter2">valueof2</parameter>\n
</instance>
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Template Instance Tree</string> </value>
</item>
<item>
<key> <string>url_string</string> </key>
<value> <string>http://example.com/root/software/release</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Person" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Author</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>__translation_dict</string> </key>
<value>
<dictionary/>
</value>
</item>
<item>
<key> <string>_count</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>_mt_index</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAM=</string> </persistent>
</value>
</item>
<item>
<key> <string>_tree</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAQ=</string> </persistent>
</value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>first_name</string> </key>
<value> <string>Member</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_member</string> </value>
</item>
<item>
<key> <string>last_name</string> </key>
<value> <string>Template</string> </value>
</item>
<item>
<key> <string>password</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAU=</string> </persistent>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Person</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Length" module="BTrees.Length"/>
</pickle>
<pickle> <int>0</int> </pickle>
</record>
<record id="3" aka="AAAAAAAAAAM=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="4" aka="AAAAAAAAAAQ=">
<pickle>
<global name="OOBTree" module="BTrees.OOBTree"/>
</pickle>
<pickle>
<none/>
</pickle>
</record>
<record id="5" aka="AAAAAAAAAAU=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary>
<item>
<key> <string>default</string> </key>
<value> <string>{SSHA}f1gAG3A53rfwjkLB/+Ex89MtocZz/4V9K4TZ</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Address" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>city</string> </key>
<value> <string>azezae</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>default_address</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Address</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>street_address</string> </key>
<value> <string>address</string> </value>
</item>
<item>
<key> <string>zip_code</string> </key>
<value> <string>123456</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Career" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>categories</string> </key>
<value>
<tuple>
<string>role/client</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>default_career</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Career</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Email" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>default_email</string> </value>
</item>
<item>
<key> <string>int_index</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Email</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>title</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>url_string</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Telephone" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>coordinate_text</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>default_telephone</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Telephone</string> </value>
</item>
<item>
<key> <string>sid</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>telephone_number</string> </key>
<value>
<none/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Software Installation" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_software_installation</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Software Installation</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Slave Instance" module="erp5.portal_type"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_Access_contents_information_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Add_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Delete_objects_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_Modify_portal_content_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>_View_Permission</string> </key>
<value>
<tuple>
<string>Assignee</string>
<string>Assignor</string>
<string>Associate</string>
<string>Auditor</string>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>connection_xml</string> </key>
<value> <string encoding="cdata"><![CDATA[
<?xml version=\'1.0\' encoding=\'utf-8\'?>\n
<instance>\n
<parameter id="parameter1">valueof1</parameter>\n
<parameter id="parameter2">https://niut:pass@example.com:4567/arfarf/oink?m=1#4.5</parameter>\n
</instance>\n
]]></string> </value>
</item>
<item>
<key> <string>default_destination_reference</string> </key>
<value> <string>02</string> </value>
</item>
<item>
<key> <string>default_reference</string> </key>
<value> <string>SItestVifibSlaposRestAPIV1.TestVifibSlaposRestAPIV1.test_instance_destruction_started0.325656030454</string> </value>
</item>
<item>
<key> <string>default_source_reference</string> </key>
<value> <string>RootSoftwareInstance</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>template_slave_instance</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Slave Instance</string> </value>
</item>
<item>
<key> <string>sla_xml</string> </key>
<value> <string encoding="cdata"><![CDATA[
<?xml version=\'1.0\' encoding=\'utf-8\'?>\n
<instance>\n
<parameter id="computer_guid">SOMECOMP</parameter>\n
</instance>\n
]]></string> </value>
</item>
<item>
<key> <string>text_content</string> </key>
<value> <string encoding="cdata"><![CDATA[
<?xml version="1.0" encoding="utf-8"?>\n
<instance>\n
<parameter id="parameter1">valueof1</parameter>\n
<parameter id="parameter2">valueof2</parameter>\n
</instance>
]]></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Template Slave Instance</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -30,6 +30,7 @@
<item>destination_project</item>
<item>destination_section</item>
<item>specialise</item>
<item>subordination</item>
</portal_type>
<portal_type id="Slave Instance">
<item>aggregate</item>
......
......@@ -83,15 +83,21 @@
</item>
<item>
<key> <string>preferred_aggregated_consumption_sale_trade_condition</string> </key>
<value> <string>sale_trade_condition_module/slapos_aggregated_consumption_trade_condition</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>preferred_aggregated_sale_trade_condition</string> </key>
<value> <string>sale_trade_condition_module/slapos_aggregated_trade_condition_v3</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>preferred_aggregated_subscription_sale_trade_condition</string> </key>
<value> <string>sale_trade_condition_module/slapos_aggregated_subscription_trade_condition_v3</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>preferred_authentication_failure_block_duration</string> </key>
......@@ -112,12 +118,16 @@
</value>
</item>
<item>
<key> <string>preferred_credential_alarm_automatic_call</string> </key>
<key> <string>preferred_cloud_contract_enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>preferred_credential_alarm_automatic_call</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>preferred_credential_recovery_automatic_approval</string> </key>
<value> <int>1</int> </value>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>preferred_credential_request_automatic_approval</string> </key>
......@@ -129,13 +139,15 @@
</item>
<item>
<key> <string>preferred_default_pre_payment_template</string> </key>
<value> <string>accounting_module/slapos_pre_payment_template</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>preferred_document_conversion_server_url</string> </key>
<value>
<tuple>
<string>https://cloudooo.erp5.net/</string>
<string>https://cloudooo.erp5.net/,https://cloudooo1.erp5.net/</string>
</tuple>
</value>
</item>
......@@ -175,19 +187,9 @@
</item>
<item>
<key> <string>preferred_instance_delivery_template</string> </key>
<value> <string>sale_packing_list_module/slapos_accounting_instance_delivery_template</string> </value>
</item>
<item>
<key> <string>preferred_instance_destroy_movement_template</string> </key>
<value> <string>sale_packing_list_module/slapos_accounting_instance_delivery_line_template/destroy</string> </value>
</item>
<item>
<key> <string>preferred_instance_setup_movement_template</string> </key>
<value> <string>sale_packing_list_module/slapos_accounting_instance_delivery_line_template/setup</string> </value>
</item>
<item>
<key> <string>preferred_instance_update_movement_template</string> </key>
<value> <string>sale_packing_list_module/slapos_accounting_instance_delivery_line_template/update</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>preferred_max_authentication_failure</string> </key>
......@@ -284,7 +286,9 @@
</item>
<item>
<key> <string>preferred_regularisation_request_template</string> </key>
<value> <string>regularisation_request_module/slapos_crm_regularisation_request_template</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>preferred_regularisation_request_use</string> </key>
......@@ -313,6 +317,7 @@
<value>
<tuple>
<string>function/customer</string>
<string>role/client</string>
</tuple>
</value>
</item>
......@@ -332,7 +337,9 @@
</item>
<item>
<key> <string>preferred_support_request_template</string> </key>
<value> <string>support_request_module/slapos_crm_support_request_template</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>preferred_support_request_use</string> </key>
......@@ -352,7 +359,9 @@
</item>
<item>
<key> <string>preferred_web_message_template</string> </key>
<value> <string>event_module/slapos_crm_web_message_template</string> </value>
<value>
<none/>
</value>
</item>
<item>
<key> <string>preferred_wechat_integration_site</string> </key>
......
portal = context.getPortalObject()
select_dict= {'default_aggregate_uid': None}
portal.portal_catalog.searchAndActivate(
portal_type=('Slave Instance', 'Software Instance'),
validation_state='validated',
default_aggregate_uid=None,
select_dict=select_dict,
left_join_list=select_dict.keys(),
method_id='SoftwareInstance_tryToInvalidateIfDestroyed',
activate_kw={'tag': tag},
**{"slapos_item.slap_state": "destroy_requested"}
......
......@@ -5,6 +5,7 @@ portal.portal_catalog.searchAndActivate(
free_for_request=0,
parent_portal_type='Remote Node',
method_id='ComputePartition_propagateRemoteNode',
method_kw={"activate_kw": {'tag': tag}},
activate_kw={'tag': tag}
)
......
portal = context.getPortalObject()
aggregate_value = portal.restrictedTraverse(aggregate)
return portal.portal_catalog.getResultValue(
portal_type = 'Support Request',
title = title,
simulation_state = ["validated", "submitted", "suspended"],
default_aggregate_uid = aggregate_value.getUid(),
portal_type='Support Request',
title={'query': title, 'key': 'ExactMatch'},
simulation_state=["validated", "submitted", "suspended"],
causality__uid=context.getUid(),
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>title, aggregate</string> </value>
<value> <string>title</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
......@@ -4,8 +4,9 @@ alarm_tool = portal.portal_alarms
if alarm_tool.isSubscribed() and len(alarm_id_list):
# No alarm tool is not subscribed, respect this choice and do not activate any alarm
tag = "%s-%s" % (script.id, context.getRelativeUrl())
tag = None
if must_reindex_context:
tag = "%s-%s" % (script.id, context.getRelativeUrl())
context.reindexObject(activate_kw={'tag': tag})
for alarm_id in alarm_id_list:
......@@ -13,10 +14,28 @@ if alarm_tool.isSubscribed() and len(alarm_id_list):
if alarm.isEnabled():
# do nothing if the alarm is not enabled
if alarm.isActive():
if tag is not None:
activate_kw = {}
activate_kw['activity'] = 'SQLQueue'
activate_kw['after_tag'] = tag
# Wait for the previous alarm run to be finished
context.activate(after_path=alarm.getPath()).Base_reindexAndSenseAlarm([alarm_id], must_reindex_context=False)
context.activate(**activate_kw).Base_reindexAndSenseAlarm([alarm_id],
must_reindex_context=False)
elif alarm.isActive():
activate_kw = {}
activate_kw['priority'] = 3
activate_kw['after_path_and_method_id'] = (alarm.getPath(), 'getId')
# Wait for the previous alarm run to be finished
# call on alarm tool to gather and drop with sqldict
alarm_tool.activate(**activate_kw).Base_reindexAndSenseAlarm([alarm_id],
must_reindex_context=False)
else:
# Do not call directly call activeSense, because in case of concurrency,
# it will trigger the alarm multiple time in parallel
# Wait for the previous alarm run to be finished
# wait for the context to be reindexed before activating the alarm
# ROMAIN: SQLQueue is used, because I'm not sure if SQLDict drop activities with different after_tag
alarm.activate(queue='SQLQueue', after_tag=tag).activeSense()
# ROMAIN: getId is used, because most alarm script ends with an getId activity
# priority=3, to be executed after all reindex, but also execute simulation _expand
alarm.activate(priority=3).activeSense()
# Prevent 2 nodes to call activateSense concurrently
alarm.serialize()
......@@ -13,14 +13,13 @@ elif slap_state == 'busy':
instance = portal.portal_catalog.getResultValue(
portal_type="Software Instance",
validation_state="validated",
aggregate__uid=context.getUid(),
)
if (instance is None) or (instance.getSlapState() not in ["start_requested", "stop_requested"]):
if (instance is None):
# XXX Not very elegant
if (compute_node.getPortalType() == 'Remote Node') and (context.getId() == 'SHARED_REMOTE'):
return ['ANY_URL']
return []
return ['INSTANCE NOT INDEXED YET']
else:
return [instance.getUrlString()]
......
from zExceptions import Unauthorized
if REQUEST is not None:
raise Unauthorized
portal = context.getPortalObject()
compute_partition = context
......@@ -7,32 +11,109 @@ assert remote_node.getPortalType() == 'Remote Node'
remote_project = remote_node.getDestinationProjectValue(portal_type='Project')
remote_person = remote_node.getDestinationSectionValue(portal_type='Person')
if compute_partition.getId() == 'SHARED_REMOTE':
# Hardcoded ID behaviour
local_instance_list = portal.portal_catalog(
portal_type='Slave Instance',
aggregate__uid=compute_partition.getUid()
)
if local_instance_list is None:
if compute_partition.getId() == 'SHARED_REMOTE':
# Hardcoded ID behaviour
local_instance_list = portal.portal_catalog(
portal_type='Slave Instance',
aggregate__uid=compute_partition.getUid(),
validation_state='validated'
)
else:
local_instance_list = portal.portal_catalog(
portal_type='Software Instance',
aggregate__uid=compute_partition.getUid(),
validation_state='validated'
)
else:
local_instance_list = [portal.portal_catalog.getResultValue(
portal_type='Software Instance',
aggregate__uid=compute_partition.getUid()
)]
local_instance_list = [portal.restrictedTraverse(x) for x in local_instance_list]
for local_instance in local_instance_list:
# XXX TODO this will increase the workflow history
assert local_instance.getAggregate() == compute_partition.getRelativeUrl()
# If local instance destruction has been propagated, do nothing
if local_instance.getValidationState() != 'validated':
continue
# if local instance is destroyed, propagate blindly
if local_instance.getSlapState() == 'destroy_requested':
remote_person.requestSoftwareInstance(
project_reference=remote_project.getReference(),
software_release=local_instance.getUrlString(),
software_title='_remote_%s_%s' % (remote_node.getFollowUpReference(), local_instance.getReference()),
software_type=local_instance.getSourceReference(),
instance_xml=local_instance.getTextContent(),
sla_xml=None,
shared=(local_instance.getPortalType() == 'Slave Instance'),
state='destroyed'
)
local_instance.invalidate(comment='Remote destruction has been propagated')
# Try to no trigger the script again on this object
local_instance.reindexObject(activate_kw=activate_kw)
requested_instance_tree = context.REQUEST.get('request_instance_tree')
if requested_instance_tree is not None:
requested_instance_tree.reindexObject(activate_kw=activate_kw)
return
# do not increase the workflow history
# Use the 'cached' API instead
remote_person.requestSoftwareInstance(
project_reference=remote_project.getReference(),
software_release=local_instance.getUrlString(),
software_title='_remote_%s_%s' % (remote_node.getFollowUpReference(), local_instance.getReference()),
software_type=local_instance.getSourceReference(),
instance_xml=local_instance.getTextContent(),
sla_xml=None,
shared=(local_instance.getPortalType() == 'Slave Instance'),
state={'start_requested': 'started', 'stop_requested': 'stopped'}[local_instance.getSlapState()]
# manually search the instance and compare all parameters
remote_instance_tree = portal.portal_catalog.getResultValue(
portal_type='Instance Tree',
validation_state='validated',
destination_section__uid=remote_person.getUid(),
follow_up__uid=remote_project.getUid(),
title={'query': '_remote_%s_%s' % (local_instance.getFollowUpReference(),
local_instance.getReference()),
'key': 'ExactMatch'}
)
requested_software_instance = context.REQUEST.get('request_instance')
if requested_software_instance is not None:
local_instance.setConnectionXml(requested_software_instance.getConnectionXml())
if remote_instance_tree is not None:
requested_software_instance = remote_instance_tree.getSuccessorValue(title=remote_instance_tree.getTitle())
if (remote_instance_tree is not None) and \
((local_instance.getUrlString() != remote_instance_tree.getUrlString()) or \
(local_instance.getSourceReference() != remote_instance_tree.getSourceReference())):
# Try to create an Upgrade Decision for the new release
# XXX Move this code to InstanceTree_createUpgradeDecision, and pass only string arguments to it
_, new_release_variation, new_type_variation = remote_instance_tree.asContext(
url_string=local_instance.getUrlString(),
source_reference=local_instance.getSourceReference()
).InstanceTree_getSoftwareProduct()
if new_release_variation is None:
return
else:
return remote_instance_tree.InstanceTree_createUpgradeDecision(
target_software_release=new_release_variation,
target_software_type=new_type_variation
)
if (remote_instance_tree is None) or \
(local_instance.getTextContent() != remote_instance_tree.getTextContent()) or \
(local_instance.getSlapState() != remote_instance_tree.getSlapState()):
remote_person.requestSoftwareInstance(
project_reference=remote_project.getReference(),
software_release=local_instance.getUrlString(),
software_title='_remote_%s_%s' % (remote_node.getFollowUpReference(), local_instance.getReference()),
software_type=local_instance.getSourceReference(),
instance_xml=local_instance.getTextContent(),
sla_xml=None,
shared=(local_instance.getPortalType() == 'Slave Instance'),
state={'start_requested': 'started', 'stop_requested': 'stopped'}[local_instance.getSlapState()]
)
requested_software_instance = context.REQUEST.get('request_instance')
requested_instance_tree = context.REQUEST.get('request_instance_tree')
# Try to no trigger the script again on this object
requested_instance_tree.reindexObject(activate_kw=activate_kw)
if requested_software_instance is not None:
requested_software_instance.reindexObject(activate_kw=activate_kw)
if (requested_software_instance is not None) and \
(requested_software_instance.getConnectionXml() != local_instance.getConnectionXml()):
# Try to no trigger the script again on this object
local_instance.edit(
connection_xml=requested_software_instance.getConnectionXml(),
activate_kw=activate_kw
)
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
<value> <string>local_instance_list=None, activate_kw=None, REQUEST=None</string> </value>
</item>
<item>
<key> <string>id</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>editable</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_reference</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>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_read_only_reference</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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>editable</string>
</list>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_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>editable</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>field_id</string> </key>
<value> <string>my_view_mode_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>my_translated_validation_state_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_translated_workflow_state_title</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</string> </value>
</item>
<item>
<key> <string>target</string> </key>
<value> <string>Click to edit the target</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
"""Hook called when a compute_node object is closed.
We want to reset reference, which is the user login in ERP5Security.
One exception is when a person object is installed from business template.
"""
if context.getPortalType() != "Instance Node":
return
context.setUserId(None)
context.InstanceNode_init()
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Script" module="erp5.portal_type"/>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
......@@ -50,20 +50,42 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Instance_invalidate</string> </value>
<key> <string>_proxy_roles</string> </key>
<value>
<tuple>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Script</string> </value>
<key> <string>id</string> </key>
<value> <string>InstanceNode_afterClone</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>title</string> </key>
<key> <string>roles</string> </key>
<value>
<none/>
<tuple>
<string>Owner</string>
</tuple>
</value>
</item>
</dictionary>
......
......@@ -26,7 +26,7 @@ if url_string:
software_type = portal.portal_catalog.getResultValue(
parent_uid=software_product.getUid(),
title=context.getSourceReference(),
title={'query': context.getSourceReference(), 'key': 'ExactMatch'},
portal_type="Software Product Type Variation"
)
......
......@@ -112,20 +112,10 @@ if 'network_guid' in filter_kw:
network_guid = filter_kw.pop('network_guid')
query_kw["default_subordination_reference"] = SimpleQuery(default_subordination_reference=network_guid)
"""
if 'project_guid' in filter_kw:
# This implementation isn't optimal, as we would prefere place a direct query rather them make an
# direct query.
project_reference = filter_kw.pop("project_guid")
if 'parent_reference' not in query_kw:
# Get Compute Node list from Tracking API
from DateTime import DateTime
project = context.portal_catalog.getResultValue(portal_type="Project", reference=project_reference)
if project is not None:
query_kw["parent_reference"] = SimpleQuery(parent_reference=project.Project_getComputeNodeReferenceList())
"""
# This is kept for compatibility for instance trees containing such parameter
# If the reference does not match the project_uid, it will never be allocated
query_kw['parent__follow_up__reference'] = filter_kw.pop("project_guid")
if computer_network_query:
if query_kw.get("default_subordination_reference"):
......
"""Hook called when a compute_node object is closed.
We want to reset reference, which is the user login in ERP5Security.
One exception is when a person object is installed from business template.
"""
if context.getPortalType() != "Remote Node":
return
context.setUserId(None)
context.RemoteNode_init()
......@@ -2,7 +2,7 @@
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="Workflow Script" module="erp5.portal_type"/>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
......@@ -50,25 +50,43 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<key> <string>_proxy_roles</string> </key>
<value>
<none/>
<tuple>
<string>Manager</string>
<string>Owner</string>
</tuple>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Person_requestSupportRequest</string> </value>
<key> <string>guard</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
<item>
<key> <string>portal_type</string> </key>
<value> <string>Workflow Script</string> </value>
<key> <string>id</string> </key>
<value> <string>RemoteNode_afterClone</string> </value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="Guard" module="Products.DCWorkflow.Guard"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>title</string> </key>
<value> <string>Person_requestSupportRequest</string> </value>
<key> <string>roles</string> </key>
<value>
<tuple>
<string>Owner</string>
</tuple>
</value>
</item>
</dictionary>
</pickle>
......
......@@ -4,7 +4,7 @@ We want to reset reference, which is the user login in ERP5Security.
One exception is when a person object is installed from business template.
"""
# Slave Instance don't have user id to be set.
if context.getPortalType() in ["Slave Instance", "Subscription Condition"]:
if context.getPortalType() in ["Slave Instance"]:
return
context.setUserId(None)
......
......@@ -6,7 +6,17 @@ if context.getPortalType() not in ('Software Instance', 'Slave Instance'):
raise TypeError('%s is not supported' % context.getPortalType())
software_instance = context
if software_instance.getValidationState() == 'validated' \
and software_instance.getSlapState() == 'destroy_requested' \
and software_instance.getAggregateValue(portal_type='Compute Partition') is None:
software_instance.invalidate(comment='Invalidated as unallocated and destroyed')
if (software_instance.getValidationState() == 'validated') \
and (software_instance.getSlapState() == 'destroy_requested'):
partition = software_instance.getAggregateValue(portal_type='Compute Partition')
if partition is None:
software_instance.invalidate(comment='Invalidated as unallocated and destroyed')
elif (partition.getParentValue().getPortalType() == 'Compute Node') and \
(software_instance.getPortalType() == 'Slave Instance'):
# Invalidate ONLY IF the partition is inside a Compute Node, which does not report destruction
software_instance.invalidate(comment='Invalidated as Compute Node does not report destruction of Slave Instance')
# Software Instance allocated on a Compute Node is invalidated by SlapTool
instance = context
if instance.getSlapState() != 'destroy_requested':
return
if instance.getValidationState() != 'invalidated':
# Node must confirm the destruction before unallocation
return
partition = instance.getAggregateValue(portal_type="Compute Partition")
portal = instance.getPortalObject()
......@@ -13,7 +16,7 @@ if partition is not None:
instance.unallocatePartition()
instance_sql_list = portal.portal_catalog(
portal_type=["Software Instance", "Slave Instance"],
default_aggregate_uid=partition.getUid(),
aggregate__uid=partition.getUid(),
)
count = len(instance_sql_list)
if count == 0:
......
......@@ -85,10 +85,6 @@
<key> <string>center</string> </key>
<value>
<list>
<string>my_preferred_aggregated_sale_trade_condition</string>
<string>my_preferred_aggregated_subscription_sale_trade_condition</string>
<string>my_preferred_aggregated_consumption_sale_trade_condition</string>
<string>my_preferred_default_pre_payment_subscription_invoice_template</string>
<string>my_preferred_rest_api_token_server_url</string>
</list>
</value>
......@@ -103,12 +99,9 @@
<key> <string>left</string> </key>
<value>
<list>
<string>my_preferred_default_pre_payment_template</string>
<string>my_preferred_instance_delivery_template</string>
<string>my_preferred_hateoas_url</string>
<string>my_preferred_slapos_web_site_url</string>
<string>my_preferred_shacache_website_expected_state</string>
<string>my_preferred_cloud_contract_enabled</string>
<string>my_preferred_wechat_integration_site</string>
<string>my_preferred_wechat_payment_service_reference</string>
<string>my_preferred_payzen_integration_site</string>
......@@ -121,10 +114,7 @@
<value>
<list>
<string>my_preferred_regularisation_request_resource</string>
<string>my_preferred_regularisation_request_template</string>
<string>my_preferred_regularisation_request_use_list</string>
<string>my_preferred_support_request_template</string>
<string>my_preferred_web_message_template</string>
<string>my_preferred_support_request_creation_limit</string>
</list>
</value>
......
<?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_preferred_aggregated_consumption_sale_trade_condition</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_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</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>Preferred Aggregated Consumption Sale Trade Condition</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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_preferred_aggregated_sale_trade_condition</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_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</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>Preferred Aggregated Sale Trade Condition</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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_preferred_aggregated_subscription_sale_trade_condition</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_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</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>Preferred Aggregated Subscription Sale Trade Condition</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="CheckBoxField" module="Products.Formulator.StandardFields"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>id</string> </key>
<value> <string>my_preferred_cloud_contract_enabled</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>
<item>
<key> <string>required_not_found</string> </key>
<value> <string>This field is mandatory.</string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>overrides</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>tales</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</value>
</item>
<item>
<key> <string>values</string> </key>
<value>
<dictionary>
<item>
<key> <string>alternate_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>css_class</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>default</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>editable</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>enabled</string> </key>
<value> <int>1</int> </value>
</item>
<item>
<key> <string>external_validator</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>extra</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>hidden</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>required</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Cloud Contract Enabled</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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_preferred_default_pre_payment_subscription_invoice_template</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_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</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>Preferred Default Pre Payment Sale Invoice Template</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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_preferred_default_pre_payment_template</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_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</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>Preferred Default Pre Payment Template</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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_preferred_instance_delivery_template</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_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</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>Preferred Instance Delivery Template</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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_preferred_regularisation_request_template</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_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</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>Preferred Regularisation Request Template</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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_preferred_support_request_template</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_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</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>Preferred Support Request Template</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?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_preferred_web_message_template</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_string_field</string> </value>
</item>
<item>
<key> <string>form_id</string> </key>
<value> <string>Base_viewFieldLibrary</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>Preferred Web Message Template</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -494,8 +494,8 @@ class TestSlapOSCloudSlapOSComputeNodeMixin_getCacheComputeNodeInformation(
self.project = self.addProject()
# Prepare compute_node
self.compute_node = self.portal.compute_node_module.template_compute_node\
.Base_createCloneDocument(batch_mode=1)
self.compute_node = self.portal.compute_node_module\
.newContent(portal_type="Compute Node")
self.compute_node.edit(
title="Compute Node %s" % self.new_id,
reference="TESTCOMP-%s" % self.new_id,
......
......@@ -53,7 +53,7 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin):
def _installSoftware(self, compute_node, url):
software_installation = self.portal.software_installation_module\
.template_software_installation.Base_createCloneDocument(batch_mode=1)
.newContent(portal_type="Software Installation")
software_installation.edit(url_string=url,
reference='TESTSOFTINST-%s' % self.generateNewId(),
aggregate=compute_node.getRelativeUrl())
......@@ -63,10 +63,6 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin):
compute_node.reindexObject()
self.tic()
def _makeSlaveTreeXXX(self, project, requested_template_id='template_slave_instance'):
SlapOSTestCaseMixin._makeTree(self, project,
requested_template_id=requested_template_id)
def test_person_allocation_checked(self):
software_instance, _, _ = self.makeAllocableSoftwareInstance()
with TemporaryAlarmScript(self.portal, 'Person_isAllowedToAllocate',
......@@ -389,7 +385,7 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin):
portal_type='Compute Partition'))
software_instance2 = self.portal.software_instance_module\
.template_software_instance.Base_createCloneDocument(batch_mode=1)
.newContent(portal_type="Software Instance")
software_instance2.edit(
title=self.generateNewSoftwareTitle(),
reference="TESTSI-%s" % self.generateNewId(),
......@@ -398,7 +394,9 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin):
text_content=self.generateSafeXml(),
sla_xml=sla_xml,
specialise_value=instance_tree,
follow_up_value=project
follow_up_value=project,
ssl_key='foo',
ssl_certificate='bar'
)
self.portal.portal_workflow._jumpToStateFor(software_instance2, 'start_requested')
self.portal.portal_workflow._jumpToStateFor(software_instance2, 'validated')
......@@ -482,7 +480,7 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin):
)
software_instance2 = self.portal.software_instance_module\
.template_software_instance.Base_createCloneDocument(batch_mode=1)
.newContent(portal_type="Software Instance")
software_instance2.edit(
title=self.generateNewSoftwareTitle(),
reference="TESTSI-%s" % self.generateNewId(),
......@@ -491,7 +489,9 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin):
text_content=self.generateSafeXml(),
sla_xml=sla_xml,
specialise=instance_tree.getRelativeUrl(),
follow_up_value=project
follow_up_value=project,
ssl_key='foo',
ssl_certificate='bar'
)
self.portal.portal_workflow._jumpToStateFor(software_instance2, 'start_requested')
software_instance2.validate()
......@@ -503,7 +503,7 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin):
)
software_instance3 = self.portal.software_instance_module\
.template_software_instance.Base_createCloneDocument(batch_mode=1)
.newContent(portal_type="Software Instance")
software_instance3.edit(
title=self.generateNewSoftwareTitle(),
reference="TESTSI-%s" % self.generateNewId(),
......@@ -512,7 +512,9 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin):
text_content=self.generateSafeXml(),
sla_xml=sla_xml,
specialise=instance_tree.getRelativeUrl(),
follow_up_value=project
follow_up_value=project,
ssl_key='foo',
ssl_certificate='bar'
)
self.portal.portal_workflow._jumpToStateFor(software_instance3, 'start_requested')
software_instance3.validate()
......@@ -609,7 +611,7 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin):
portal_type='Compute Partition'))
software_instance2 = self.portal.software_instance_module\
.template_software_instance.Base_createCloneDocument(batch_mode=1)
.newContent(portal_type="Software Instance")
software_instance2.edit(
title=self.generateNewSoftwareTitle(),
reference="TESTSI-%s" % self.generateNewId(),
......@@ -618,7 +620,9 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin):
text_content=self.generateSafeXml(),
sla_xml=sla_xml,
specialise_value=instance_tree,
follow_up_value=project
follow_up_value=project,
ssl_key='foo',
ssl_certificate='bar'
)
self.portal.portal_workflow._jumpToStateFor(software_instance2, 'start_requested')
self.portal.portal_workflow._jumpToStateFor(software_instance2, 'validated')
......@@ -763,38 +767,39 @@ class TestSlapOSAllocation(SlapOSTestCaseMixin):
def check_allocation_capability(self, capability, bad_capability_list,
good_capability=None):
good_capability = good_capability or capability
self._makeTree()
self._makeComputeNode()
self.partition.edit(subject=capability)
software_instance, compute_node, partition = self.makeAllocableSoftwareInstance()
self._installSoftware(self.compute_node,
self.software_instance.getUrlString())
partition.edit(subject=capability)
self.assertEqual(compute_node.getAllocationScope(), "open")
self.assertEqual(compute_node.getCapacityScope(), "open")
self.assertEqual(None,
self.software_instance.getAggregate(portal_type='Compute Partition'))
self.tic()
self.assertEqual(None, software_instance.getAggregateValue(
portal_type='Compute Partition'))
for bad_capability in bad_capability_list:
self.software_instance.setSlaXml("""<?xml version='1.0' encoding='utf-8'?>
software_instance.setSlaXml("""<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id='capability'>%s</parameter>
</instance>""" % bad_capability)
self.software_instance.SoftwareInstance_tryToAllocatePartition()
software_instance.SoftwareInstance_tryToAllocatePartition()
try:
partition = self.software_instance.getAggregate(
allocated_partition = software_instance.getAggregate(
portal_type='Compute Partition')
self.assertEqual(None, partition)
self.assertEqual(None, allocated_partition)
except AssertionError:
raise AssertionError("Allocated %s on %s with capability %s" % (
bad_capability, partition, capability))
bad_capability, allocated_partition, capability))
self.software_instance.setSlaXml("""<?xml version='1.0' encoding='utf-8'?>
software_instance.setSlaXml("""<?xml version='1.0' encoding='utf-8'?>
<instance>
<parameter id='capability'>%s</parameter>
</instance>""" % good_capability)
self.software_instance.SoftwareInstance_tryToAllocatePartition()
self.assertEqual(self.partition.getRelativeUrl(),
self.software_instance.getAggregate(portal_type='Compute Partition'))
software_instance.SoftwareInstance_tryToAllocatePartition()
self.assertEqual(partition.getRelativeUrl(),
software_instance.getAggregate(portal_type='Compute Partition'))
@simulate('Person_isAllowedToAllocate', '*args, **kwargs', 'return True')
def test_allocation_capability(self):
......
......@@ -29,8 +29,8 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflow(SlapOSTestCaseMixin):
SlapOSTestCaseMixin.afterSetUp(self)
self.project = self.addProject()
# Clone compute_node document
self.compute_node = self.portal.compute_node_module.template_compute_node\
.Base_createCloneDocument(batch_mode=1)
self.compute_node = self.portal.compute_node_module\
.newContent(portal_type="Compute Node")
new_id = self.generateNewId()
self.compute_node.edit(
title="compute node %s" % (new_id, ),
......@@ -491,8 +491,8 @@ class TestSlapOSCoreComputeNodeSlapInterfaceWorkflowSupply(SlapOSTestCaseMixin):
self.project = self.addProject()
# Clone compute_node document
compute_node = portal.compute_node_module.template_compute_node\
.Base_createCloneDocument(batch_mode=1)
compute_node = portal.compute_node_module\
.newContent(portal_type="Compute Node")
# Clone person document
person_user = self.makePerson(self.project, new_id=self.new_id, index=0)
self.addProjectProductionManagerAssignment(person_user, self.project)
......
......@@ -26,8 +26,8 @@ class TestSlapOSCoreComputePartitionSlapInterfaceWorkflow(SlapOSTestCaseMixin):
self.login()
SlapOSTestCaseMixin.afterSetUp(self)
# Clone compute_node document
self.compute_node = self.portal.compute_node_module.template_compute_node\
.Base_createCloneDocument(batch_mode=1)
self.compute_node = self.portal.compute_node_module\
.newContent(portal_type="Compute Node")
self.compute_node.edit(
title="compute node %s" % (self.new_id, ),
reference="TESTCOMP-%s" % (self.new_id, ),
......
......@@ -45,12 +45,12 @@ class TestSlapOSConstraintMixin(SlapOSTestCaseMixin):
class TestSlapOSComputePartitionConstraint(TestSlapOSConstraintMixin):
def test_non_busy_partition_has_no_related_instance(self):
compute_node = self.portal.compute_node_module.template_compute_node\
.Base_createCloneDocument(batch_mode=1)
compute_node = self.portal.compute_node_module\
.newContent(portal_type="Compute Node")
partition = compute_node.newContent(portal_type='Compute Partition')
self.portal.portal_workflow._jumpToStateFor(partition, 'free')
software_instance = self.portal.software_instance_module\
.template_software_instance.Base_createCloneDocument(batch_mode=1)
.newContent(portal_type="Software Instance")
slave_instance = self.portal.software_instance_module.newContent(
portal_type='Slave Instance')
......@@ -84,15 +84,15 @@ class TestSlapOSComputePartitionConstraint(TestSlapOSConstraintMixin):
self.portal.portal_workflow._jumpToStateFor(partition, 'free')
def test_busy_partition_has_one_related_instance(self):
compute_node = self.portal.compute_node_module.template_compute_node\
.Base_createCloneDocument(batch_mode=1)
compute_node = self.portal.compute_node_module\
.newContent(portal_type="Compute Node")
partition = compute_node.newContent(portal_type='Compute Partition')
self.portal.portal_workflow._jumpToStateFor(partition, 'busy')
software_instance = self.portal.software_instance_module\
.template_software_instance.Base_createCloneDocument(batch_mode=1)
.newContent(portal_type="Software Instance")
software_instance.edit(aggregate=partition.getRelativeUrl())
software_instance_2 = self.portal.software_instance_module\
.template_software_instance.Base_createCloneDocument(batch_mode=1)
.newContent(portal_type="Software Instance")
slave_instance = self.portal.software_instance_module.newContent(
portal_type='Slave Instance')
slave_instance_2 = self.portal.software_instance_module.newContent(
......@@ -475,21 +475,6 @@ class TestSlapOSInstanceTreeConstraint(TestSlapOSConstraintMixin):
class TestSlapOSPersonConstraint(TestSlapOSConstraintMixin):
def test_role(self):
person = self.portal.person_module.newContent(portal_type='Person')
consistency_message = 'One role should be defined'
self.assertTrue(consistency_message in self.getMessageList(person))
role_id_list = list(self.portal.portal_categories.role.objectIds())
self.assertTrue(len(role_id_list) >= 2)
person.setRole(role_id_list[0])
self.assertFalse(consistency_message in self.getMessageList(person))
person.setRoleList(role_id_list)
self.assertTrue(consistency_message in self.getMessageList(person))
person.setRole(role_id_list[0])
self.assertFalse(consistency_message in self.getMessageList(person))
def test_subordination_state(self):
organisation = self.portal.organisation_module.newContent(
portal_type='Organisation')
......
......@@ -46,9 +46,9 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin):
# prepare part of tree
instance_tree = portal.instance_tree_module\
.template_instance_tree.Base_createCloneDocument(batch_mode=1)
.newContent(portal_type="Instance Tree")
self.software_instance = portal.software_instance_module\
.template_software_instance.Base_createCloneDocument(batch_mode=1)
.newContent(portal_type="Software Instance")
instance_tree.edit(
title=self.request_kw['software_title'],
......@@ -72,7 +72,9 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflow(SlapOSTestCaseMixin):
text_content=self.request_kw['instance_xml'],
sla_xml=self.request_kw['sla_xml'],
specialise=instance_tree.getRelativeUrl(),
follow_up_value=self.project
follow_up_value=self.project,
ssl_key='foo',
ssl_certificate='bar'
)
self.portal.portal_workflow._jumpToStateFor(self.software_instance, 'start_requested')
self.software_instance.validate()
......@@ -1068,9 +1070,9 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
# prepare part of tree
self.instance_tree = portal.instance_tree_module\
.template_instance_tree.Base_createCloneDocument(batch_mode=1)
.newContent(portal_type="Instance Tree")
self.software_instance = portal.software_instance_module\
.template_software_instance.Base_createCloneDocument(batch_mode=1)
.newContent(portal_type="Software Instance")
self.instance_tree.edit(
title=self.request_kw['software_title'],
......@@ -1094,7 +1096,9 @@ class TestSlapOSCoreInstanceSlapInterfaceWorkflowTransfer(SlapOSTestCaseMixin):
text_content=self.request_kw['instance_xml'],
sla_xml=self.request_kw['sla_xml'],
specialise=self.instance_tree.getRelativeUrl(),
follow_up_value=self.project
follow_up_value=self.project,
ssl_key='foo',
ssl_certificate='bar'
)
self.portal.portal_workflow._jumpToStateFor(self.software_instance, 'start_requested')
self.software_instance.validate()
......
......@@ -20,29 +20,8 @@
##############################################################################
from erp5.component.test.SlapOSTestCaseMixin import SlapOSTestCaseMixin
class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
def test_ComputeNode_setSubjectList(self):
project = self.addProject()
self.person_user = self.makePerson(project)
self.addProjectProductionManagerAssignment(self.person_user, project)
self.tic()
self.login(self.person_user.getUserId())
new_id = self.generateNewId()
compute_node = self.portal.compute_node_module.newContent(
portal_type='Compute Node',
title="Compute Node %s for %s" % (new_id, self.person_user.getReference()),
reference="TESTCOMP-%s" % new_id,
follow_up_value=project
)
self.tic()
assert compute_node.getDestinationSectionValue() is None
compute_node.edit(subject_list=[self.person_user.getDefaultEmailText()])
self.tic()
assert compute_node.getDestinationSection() == \
self.person_user.getRelativeUrl()
class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
def check_Instance_validate(self, portal_type):
project = self.addProject()
......@@ -97,44 +76,6 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
def test_SlaveInstance_validate(self):
return self.check_Instance_validate("Slave Instance")
def test_SlaveInstance_requestDestroy(self):
project = self.addProject()
self.person_user = self.makePerson(project)
self.login(self.person_user.getUserId())
# Instance Tree required for security.
hs = self.portal.instance_tree_module.newContent(
portal_type='Instance Tree',
title="HS %s for %s" % (self.new_id, self.person_user.getReference()),
reference="TESTHS-%s" % self.new_id,
destination_reference="TESTHS-%s" % self.new_id,
destination_section=self.person_user.getRelativeUrl(),
follow_up_value=project
)
instance = self.portal.software_instance_module.newContent(
portal_type='Slave Instance',
title="Instance %s for %s" % (self.new_id, self.person_user.getReference()),
reference="TESTINST-%s" % self.new_id,
destination_reference="TESTINST-%s" % self.new_id,
destination_section=self.person_user.getRelativeUrl(),
specialise_value=hs,
follow_up_value=project
)
request_kw = dict(
software_release='http://example.org',
software_type='http://example.org',
instance_xml=self.generateSafeXml(),
sla_xml=self.generateSafeXml(),
shared=True,
)
instance.requestStop(**request_kw)
self.assertEqual(instance.getValidationState(), 'draft')
instance.validate()
self.assertEqual(instance.getValidationState(), 'validated')
instance.requestDestroy(**request_kw)
self.assertEqual(instance.getValidationState(), 'invalidated')
def check_SoftwareInstallation_changeState(self, method_id):
project = self.addProject()
self.person_user = self.makePerson(project)
......@@ -191,15 +132,11 @@ class TestSlapOSCoreSlapOSCloudInteractionWorkflow(SlapOSTestCaseMixin):
compute_node = self.portal.compute_node_module.newContent(
portal_type='Compute Node',
title="Compute Node %s for %s" % (new_id, self.person_user.getReference()),
<<<<<<< HEAD
reference="TESTCOMP-%s" % new_id)
self._addCertificateLogin(compute_node)
=======
reference="TESTCOMP-%s" % new_id,
follow_up_value=project
)
self._addERP5Login(compute_node)
>>>>>>> 1561dc0c2 (slapos_cloud: assignment needed to touch compute node)
self._addCertificateLogin(compute_node)
partition = compute_node.newContent(
portal_type='Compute Partition',
title="Partition Compute Node %s for %s" % (new_id,
......
person = state_change['object']
portal = person.getPortalObject()
# Get required arguments
kwargs = state_change.kwargs
# Required args
# Raise TypeError if all parameters are not provided
try:
support_request_title = kwargs['support_request_title']
description = kwargs['support_request_description']
# Aggregate can be None, so it isn't included on the kwargs
aggregate = kwargs["aggregate"]
except KeyError:
raise TypeError, "Person_requestSupportRequest takes exactly 3 arguments"
aggregate_value = portal.restrictedTraverse(aggregate)
support_request_in_progress = person.Base_getSupportRequestInProgress(
title=support_request_title,
aggregate=aggregate
)
if support_request_in_progress is not None:
context.REQUEST.set("support_request_relative_url",
support_request_in_progress.getRelativeUrl())
context.REQUEST.set("support_request_in_progress",
support_request_in_progress.getRelativeUrl())
return
support_request_in_progress = context.REQUEST.get("support_request_in_progress", None)
if support_request_in_progress is not None:
support_request = portal.restrictedTraverse(support_request_in_progress, None)
if support_request and support_request.getTitle() == support_request_title and \
support_request.getAggregateUid() == aggregate_value.getUid():
context.REQUEST.set("support_request_relative_url", support_request_in_progress)
return
# Ensure resoure is Monitoring
resource = portal.service_module.\
slapos_crm_monitoring.getRelativeUrl()
support_request = portal.restrictedTraverse(
portal.portal_preferences.getPreferredSupportRequestTemplate())\
.Base_createCloneDocument(batch_mode=1)
support_request.edit(
title = support_request_title,
description = description,
start_date = DateTime(),
destination_decision=person.getRelativeUrl(),
aggregate_value=aggregate_value,
resource=resource
)
support_request.validate()
context.REQUEST.set("support_request_relative_url", support_request.getRelativeUrl())
context.REQUEST.set("support_request_in_progress", support_request.getRelativeUrl())
......@@ -31,7 +31,7 @@ if len(project_list) != 1:
compute_node_portal_type = "Compute Node"
compute_node_list = portal.portal_catalog.portal_catalog(
portal_type=compute_node_portal_type,
title=compute_node_title,
title={'query': compute_node_title, 'key': 'ExactMatch'},
follow_up__uid=project_list[0].getUid(),
limit=2
)
......
......@@ -31,7 +31,7 @@ if len(project_list) != 1:
computer_network_portal_type = "Computer Network"
computer_network_list = portal.portal_catalog.portal_catalog(
portal_type=computer_network_portal_type,
title=computer_network_title,
title={'query': computer_network_title, 'key': 'ExactMatch'},
follow_up__uid=project_list[0].getUid(),
#validation_state="validated",
limit=2)
......
......@@ -42,7 +42,7 @@ request_instance_tree_list = portal.portal_catalog(
portal_type=instance_tree_portal_type,
title={'query': software_title, 'key': 'ExactMatch'},
validation_state="validated",
default_destination_section_uid=person.getUid(),
destination_section__uid=person.getUid(),
limit=2,
)
if len(request_instance_tree_list) > 1:
......@@ -55,6 +55,14 @@ elif len(request_instance_tree_list) == 1:
(request_instance_tree.getValidationState() != "validated") or \
(request_instance_tree.getDestinationSection() != person.getRelativeUrl()):
raise NotImplementedError, "The system was not able to get the expected instance tree"
# Do not allow user to change the release/type/shared status
# This is not compatible with invoicing the service
# Instance release change will be handled by allocation supply and upgrade decision
if ((request_instance_tree.getUrlString() != software_release_url_string) or \
(request_instance_tree.getSourceReference() != software_type) or \
(request_instance_tree.getRootSlave() != is_slave)) and \
(not kwargs.get("force_software_change", False)):
raise NotImplementedError, "You can not change the release / type / shared states"
else:
if (root_state == "destroyed"):
# No need to create destroyed subscription.
......
person = state_change['object']
portal = person.getPortalObject()
# Get required arguments
kwargs = state_change.kwargs
# Required args
# Raise TypeError if all parameters are not provided
try:
support_request_title = kwargs['support_request_title']
resource = kwargs['support_request_resource']
description = kwargs['support_request_description']
project_reference = kwargs['project_reference']
# Aggregate can be None, so it isn't included on the kwargs
aggregate = kwargs.get("support_request_aggregate", None)
except KeyError:
raise TypeError, "Person_requestSupportRequest takes exactly 5 arguments"
tag = "%s_%s_SupportRequestInProgress" % (person.getUid(),
support_request_title)
if (portal.portal_activities.countMessageWithTag(tag) > 0):
# The software instance is already under creation but can not be fetched from catalog
# As it is not possible to fetch informations, it is better to raise an error
raise NotImplementedError(tag)
# Ensure project is correctly set
project_list = portal.portal_catalog.portal_catalog(portal_type='Project', reference=project_reference,
validation_state='validated', limit=2)
if len(project_list) != 1:
raise NotImplementedError("%i projects '%s'" % (len(project_list), project_reference))
support_request_portal_type = "Support Request"
module = portal.getDefaultModule(portal_type=support_request_portal_type)
support_request = module.newContent(
portal_type=support_request_portal_type,
title=support_request_title,
description=description,
resource=resource,
destination_decision_value=person,
destination_project_value=project_list[0],
aggregate=aggregate,
specialise="sale_trade_condition_module/slapos_ticket_trade_condition",
activate_kw={'tag': tag}
)
context.REQUEST.set("support_request_relative_url", support_request.getRelativeUrl())
support_request.approveRegistration()
......@@ -16,11 +16,9 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_notify</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_compute_node</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_network</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_software_instance</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_support</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_token</string>
</tuple>
</value>
......
......@@ -17,11 +17,9 @@
<value>
<tuple>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_draft</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_notify</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_compute_node</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_network</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_software_instance</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_support</string>
<string>destination/portal_workflow/person_slap_interface_workflow/transition_request_token</string>
</tuple>
</value>
......
......@@ -10,7 +10,7 @@
<key> <string>categories</string> </key>
<value>
<tuple>
<string>after_script/portal_workflow/slapos_cloud_interaction_workflow/script_Instance_invalidate</string>
<string>after_script/portal_workflow/slapos_cloud_interaction_workflow/script_Instance_triggerInvalidationAlarm</string>
</tuple>
</value>
</item>
......@@ -22,7 +22,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>interaction_SlaveInstance_requestDestroy</string> </value>
<value> <string>interaction_Instance_requestDestroy</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......@@ -33,6 +33,7 @@
<value>
<tuple>
<string>Slave Instance</string>
<string>Software Instance</string>
</tuple>
</value>
</item>
......@@ -46,6 +47,10 @@
<key> <string>temporary_document_disallowed</string> </key>
<value> <int>0</int> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Instance_requestDestroy</string> </value>
</item>
<item>
<key> <string>trigger_method_id</string> </key>
<value>
......
instance = state_change["object"]
assert instance.getPortalType() == "Slave Instance"
instance.invalidate()
return state_change['object'].Base_reindexAndSenseAlarm(['slapos_cloud_invalidate_destroyed_instance'])
......@@ -60,7 +60,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>script_Person_notify</string> </value>
<value> <string>script_Instance_triggerInvalidationAlarm</string> </value>
</item>
<item>
<key> <string>portal_type</string> </key>
......@@ -68,7 +68,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Person_notify</string> </value>
<value> <string>Instance_triggerInvalidationAlarm</string> </value>
</item>
</dictionary>
</pickle>
......
This diff is collapsed.
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