Commit 9b95283d authored by Romain Courteaud's avatar Romain Courteaud

Migrate rename transition.

parent 9fec4a36
......@@ -24,8 +24,6 @@
<tuple>
<string>destroy_computer_partition</string>
<string>destroy_requested</string>
<string>lock</string>
<string>rename</string>
<string>report_computer_partition_bang</string>
<string>report_computer_partition_error</string>
<string>request_destroy_computer_partition</string>
......
......@@ -24,8 +24,6 @@
<tuple>
<string>destroy_computer_partition</string>
<string>destroy_requested</string>
<string>lock</string>
<string>rename</string>
<string>report_computer_partition_bang</string>
<string>report_computer_partition_error</string>
<string>request_destroy_computer_partition</string>
......
......@@ -24,8 +24,6 @@
<tuple>
<string>destroy_computer_partition</string>
<string>destroy_requested</string>
<string>lock</string>
<string>rename</string>
<string>report_computer_partition_bang</string>
<string>report_computer_partition_error</string>
<string>request_destroy_computer_partition</string>
......
437
\ No newline at end of file
438
\ No newline at end of file
......@@ -50,12 +50,29 @@
</item>
<item>
<key> <string>_body</string> </key>
<value> <string># Get the software_instance\n
software_instance = state_change[\'object\']\n
<value> <string encoding="cdata"><![CDATA[
instance = state_change[\'object\']\n
portal = instance.getPortalObject()\n
software_title = state_change.kwargs[\'new_name\']\n
\n
assert instance.getPortalType() in ["Slave Instance", "Software Instance"]\n
\n
hosting_subscription = instance.getSpecialiseValue(portal_type="Hosting Subscription")\n
\n
# Instance can be moved from one requester to another\n
# Prevent creating two instances with the same title\n
tag = "%s_%s_inProgress" % (hosting_subscription.getUid(), software_title)\n
if (portal.portal_activities.countMessageWithTag(tag) > 0):\n
# The software instance is already under creation but can not be fetched from catalog\n
# As it is not possible to fetch informations, it is better to raise an error\n
raise NotImplementedError(tag)\n
\n
# Change the title\n
software_instance.edit(title=state_change.kwargs[\'new_name\'])\n
</string> </value>
instance.edit(title=software_title, activate_kw={\'tag\': tag})\n
]]></string> </value>
</item>
<item>
<key> <string>_params</string> </key>
......@@ -63,11 +80,11 @@ software_instance.edit(title=state_change.kwargs[\'new_name\'])\n
</item>
<item>
<key> <string>id</string> </key>
<value> <string>SoftwareInstance_rename</string> </value>
<value> <string>RequestedInstance_rename</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Rename software instance</string> </value>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
......
......@@ -22,6 +22,7 @@
<key> <string>transitions</string> </key>
<value>
<tuple>
<string>rename</string>
<string>request_destroy</string>
<string>request_instance</string>
<string>request_start</string>
......
......@@ -22,6 +22,7 @@
<key> <string>transitions</string> </key>
<value>
<tuple>
<string>rename</string>
<string>request_destroy</string>
<string>request_instance</string>
<string>request_start</string>
......
......@@ -22,6 +22,7 @@
<key> <string>transitions</string> </key>
<value>
<tuple>
<string>rename</string>
<string>request_destroy</string>
<string>request_instance</string>
<string>request_start</string>
......
......@@ -24,7 +24,7 @@
</item>
<item>
<key> <string>after_script_name</string> </key>
<value> <string>SoftwareInstance_rename</string> </value>
<value> <string>RequestedInstance_rename</string> </value>
</item>
<item>
<key> <string>description</string> </key>
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>title</string> </key>
<value> <string>Rename Software Instance</string> </value>
<value> <string></string> </value>
</item>
<item>
<key> <string>trigger_type</string> </key>
......
10
\ No newline at end of file
11
\ 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