Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
107
Merge Requests
107
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos
Commits
6e4d08ac
Commit
6e4d08ac
authored
May 16, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always create update packing list when one parameter value changes
parent
a097d81a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
189 additions
and
15 deletions
+189
-15
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/instance_accounting_slap_interaction_workflow/interactions/change_instance_parameter.xml
...ction_workflow/interactions/change_instance_parameter.xml
+100
-0
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/instance_accounting_slap_interaction_workflow/scripts/Instance_changePromiseParameter.xml
...tion_workflow/scripts/Instance_changePromiseParameter.xml
+87
-0
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/instance_accounting_slap_interaction_workflow/scripts/Instance_changePromiseState.xml
...eraction_workflow/scripts/Instance_changePromiseState.xml
+1
-14
master/bt5/vifib_slapos_accounting/bt/revision
master/bt5/vifib_slapos_accounting/bt/revision
+1
-1
No files found.
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/instance_accounting_slap_interaction_workflow/interactions/change_instance_parameter.xml
0 → 100644
View file @
6e4d08ac
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"InteractionDefinition"
module=
"Products.ERP5.Interaction"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
actbox_category
</string>
</key>
<value>
<string>
workflow
</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>
activate_script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
after_script_name
</string>
</key>
<value>
<list>
<string>
Instance_changePromiseParameter
</string>
</list>
</value>
</item>
<item>
<key>
<string>
before_commit_script_name
</string>
</key>
<value>
<tuple/>
</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>
change_instance_parameter
</string>
</value>
</item>
<item>
<key>
<string>
method_id
</string>
</key>
<value>
<list>
<string>
_setRootSoftwareReleaseUrl
</string>
<string>
_setTextContent
</string>
<string>
_setSourceReference
</string>
<string>
_setSlaXml
</string>
</list>
</value>
</item>
<item>
<key>
<string>
once_per_transaction
</string>
</key>
<value>
<int>
1
</int>
</value>
</item>
<item>
<key>
<string>
portal_type_filter
</string>
</key>
<value>
<list>
<string>
Slave Instance
</string>
<string>
Software Instance
</string>
</list>
</value>
</item>
<item>
<key>
<string>
script_name
</string>
</key>
<value>
<tuple/>
</value>
</item>
<item>
<key>
<string>
temporary_document_disallowed
</string>
</key>
<value>
<int>
1
</int>
</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>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/instance_accounting_slap_interaction_workflow/scripts/Instance_changePromiseParameter.xml
0 → 100644
View file @
6e4d08ac
<?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
\n
# Get latest workflow transition\n
state = instance.getSlapState()\n
started = "start_requested"\n
stopped = "stop_requested"\n
\n
if (state in (started, stopped)):\n
partition = instance.getAggregate(portal_type="Computer Partition")\n
if (partition is not None):\n
portal = instance.getPortalObject()\n
delivery = instance.getCausalityValue(portal_type=["Sale Packing List"])\n
update_service_relative_url = portal.portal_preferences.getPreferredInstanceUpdateResource()\n
\n
new_delivery = delivery.Base_createCloneDocument(batch_mode=1)\n
new_delivery.edit(start_date=DateTime(), stop_date=DateTime())\n
new_delivery.contentValues(portal_type="Sale Packing List Line")[0].edit(resource=update_service_relative_url)\n
new_delivery.confirm()\n
new_delivery.start()\n
new_delivery.stop()\n
new_delivery.deliver()\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>
Instance_changePromiseParameter
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/vifib_slapos_accounting/WorkflowTemplateItem/portal_workflow/instance_accounting_slap_interaction_workflow/scripts/Instance_changePromiseState.xml
View file @
6e4d08ac
...
...
@@ -72,8 +72,6 @@ hosting_service_relative_url = portal.portal_preferences.getPreferredInstanceHos
hosting_service = portal.restrictedTraverse(hosting_service_relative_url)\n
cleanup_service_relative_url = portal.portal_preferences.getPreferredInstanceCleanupResource()\n
cleanup_service = portal.restrictedTraverse(cleanup_service_relative_url)\n
update_service_relative_url = portal.portal_preferences.getPreferredInstanceUpdateResource()\n
update_service = portal.restrictedTraverse(update_service_relative_url)\n
# Get software release\n
software_release_document = portal.portal_catalog.getResultValue(\n
portal_type=\'Software Release\',\n
...
...
@@ -209,7 +207,7 @@ else:\n
if (state == started):\n
if (delivery.getSimulationState() == \'stopped\'):\n
delivery.deliver()\n
new_delivery = letsclone(
update
_service_relative_url)\n
new_delivery = letsclone(
hosting
_service_relative_url)\n
new_delivery.confirm()\n
instance.edit(causality_value=new_delivery)\n
elif (state == stopped):\n
...
...
@@ -225,17 +223,6 @@ else:\n
elif (service_relative_url == cleanup_service_relative_url):\n
raise NotImplementedError, "Not update should be allowed"\n
\n
elif (service_relative_url == update_service_relative_url):\n
if (state == started):\n
pass\n
elif (state == stopped):\n
pass\n
elif (state == destroyed):\n
new_delivery = letsclone(cleanup_service_relative_url)\n
new_delivery.confirm()\n
instance.edit(causality_value=new_delivery)\n
else:\n
raise NotImplementedError\n
else:\n
raise NotImplementedError\n
</string>
</value>
...
...
master/bt5/vifib_slapos_accounting/bt/revision
View file @
6e4d08ac
9
\ No newline at end of file
10
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment