Commit 5ef92448 authored by Romain Courteaud's avatar Romain Courteaud

Unplug packing list management from workflow.

Software/Slave instance workflow state should now be used to get the expected
status.
parent cad2293e
<workflow_chain>
<chain>
<type>Slave Instance</type>
<workflow>software_instance_slap_interface_workflow</workflow>
</chain>
<chain>
<type>Software Instance</type>
<workflow>software_instance_slap_interface_workflow</workflow>
</chain>
</workflow_chain>
\ No newline at end of file
436
\ No newline at end of file
437
\ No newline at end of file
Slave Instance | software_instance_slap_interface_workflow
Software Instance | software_instance_slap_interface_workflow
\ No newline at end of file
<workflow_chain>
<chain>
<type>Hosting Subscription</type>
<workflow>edit_workflow, hosting_subscription_slap_interface_workflow</workflow>
<workflow>edit_workflow, instance_slap_interface_workflow</workflow>
</chain>
<chain>
<type>Slave Instance</type>
<workflow>edit_workflow, item_workflow</workflow>
<workflow>edit_workflow, instance_slap_interface_workflow, item_workflow</workflow>
</chain>
<chain>
<type>Software Instance</type>
<workflow>edit_workflow, item_workflow</workflow>
<workflow>edit_workflow, instance_slap_interface_workflow, item_workflow</workflow>
</chain>
</workflow_chain>
\ No newline at end of file
......@@ -20,7 +20,8 @@
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
<value> <string>This workflow is used to ensure consistency in a instance (software instance, slave instance, hosting subscription) tree.\r\n
It allows to request sub instances, rename, allocate, report promise status.</string> </value>
</item>
<item>
<key> <string>groups</string> </key>
......@@ -30,7 +31,7 @@
</item>
<item>
<key> <string>id</string> </key>
<value> <string>hosting_subscription_slap_interface_workflow</string> </value>
<value> <string>instance_slap_interface_workflow</string> </value>
</item>
<item>
<key> <string>initial_state</string> </key>
......@@ -52,7 +53,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Hosting Subscription Slap Interface Workflow</string> </value>
<value> <string>Instance Slap Interface Workflow</string> </value>
</item>
</dictionary>
</pickle>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>instance = state_change[\'object\']\n
portal = instance.getPortalObject()\n
# Get required arguments\n
kwargs = state_change.kwargs\n
\n
# Required args\n
# Raise TypeError if all parameters are not provided\n
try:\n
software_release_url_string = state_change.kwargs[\'software_release\']\n
software_type = kwargs["software_type"]\n
instance_xml = kwargs["instance_xml"]\n
sla_xml = kwargs["sla_xml"]\n
is_slave = kwargs["shared"]\n
except KeyError:\n
raise TypeError, "RequestedInstance_updateParameterInformation takes exactly 5 arguments"\n
\n
edit_kw = {\n
\'root_software_release_url\': software_release_url_string,\n
\'text_content\': instance_xml,\n
\'source_reference\': software_type,\n
\'sla_xml\': sla_xml,\n
}\n
\n
# Check the slave management\n
if is_slave not in [True, False]:\n
raise ValueError, "shared should be a boolean"\n
instance_portal_type = instance.getPortalType()\n
if instance_portal_type == "Hosting Subscription":\n
edit_kw[\'root_slave\'] = is_slave\n
elif instance_portal_type == "Software Instance":\n
if is_slave:\n
raise NotImplementedError, "Please destroy before doing a slave instance (%s)" % \\\n
(instance.getRelativeUrl(), )\n
elif instance_portal_type == "Slave Instance":\n
if not is_slave:\n
raise NotImplementedError, "Please destroy before doing a software instance (%s)" % \\\n
(instance.getRelativeUrl(), )\n
else:\n
raise NotImplementedError, "Not supported portal type %s (%s)" % \\\n
(instance.getPortalType(), instance.getRelativeUrl())\n
\n
instance.edit(**edit_kw)\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>state_change</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>RequestedInstance_updateParameterInformation</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -21,7 +21,10 @@
<item>
<key> <string>transitions</string> </key>
<value>
<tuple/>
<tuple>
<string>request_destroy</string>
<string>request_instance</string>
</tuple>
</value>
</item>
<item>
......
......@@ -23,6 +23,7 @@
<value>
<tuple>
<string>request_destroy</string>
<string>request_instance</string>
<string>request_start</string>
<string>request_stop</string>
</tuple>
......
......@@ -24,7 +24,7 @@
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string></string> </value>
<value> <string>RequestedInstance_updateParameterInformation</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -56,6 +56,27 @@
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>var_exprs</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
......
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="TransitionDefinition" module="Products.DCWorkflow.Transitions"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>actbox_category</string> </key>
<value> <string>workflow</string> </value>
</item>
<item>
<key> <string>actbox_icon</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>actbox_url</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string>RequesterInstance_request</string> </value>
</item>
<item>
<key> <string>description</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>guard</string> </key>
<value>
<none/>
</value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>request_instance</string> </value>
</item>
<item>
<key> <string>new_state_id</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>script_name</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>var_exprs</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
......@@ -24,7 +24,7 @@
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string></string> </value>
<value> <string>RequestedInstance_updateParameterInformation</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -56,6 +56,27 @@
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>var_exprs</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
......
......@@ -24,7 +24,7 @@
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string></string> </value>
<value> <string>RequestedInstance_updateParameterInformation</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -56,6 +56,27 @@
<key> <string>trigger_type</string> </key>
<value> <int>2</int> </value>
</item>
<item>
<key> <string>var_exprs</string> </key>
<value>
<persistent> <string encoding="base64">AAAAAAAAAAI=</string> </persistent>
</value>
</item>
</dictionary>
</pickle>
</record>
<record id="2" aka="AAAAAAAAAAI=">
<pickle>
<global name="PersistentMapping" module="Persistence.mapping"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>data</string> </key>
<value>
<dictionary/>
</value>
</item>
</dictionary>
</pickle>
</record>
......
8
\ No newline at end of file
9
\ No newline at end of file
Hosting Subscription | edit_workflow
Hosting Subscription | hosting_subscription_slap_interface_workflow
Hosting Subscription | instance_slap_interface_workflow
Slave Instance | edit_workflow
Slave Instance | instance_slap_interface_workflow
Slave Instance | item_workflow
Software Instance | edit_workflow
Software Instance | instance_slap_interface_workflow
Software Instance | item_workflow
\ No newline at end of file
hosting_subscription_slap_interface_workflow
\ No newline at end of file
instance_slap_interface_workflow
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment