Commit 041db9f6 authored by Łukasz Nowak's avatar Łukasz Nowak

Add migration script for root_software_release_url

parent 0d0897c3
......@@ -283,3 +283,13 @@ def Computer_updateLocalRoles(self):
self.updateLocalRolesOnSecurityGroups(reindex=False)
for partition in self.contentValues(portal_type='Computer Partition'):
partition.updateLocalRolesOnSecurityGroups(reindex=False)
def Instance_migrateRootSoftwareReleaseUrl(self):
@WorkflowMethod.disable
def real(self):
if self.getPortalType() not in ('Hosting Subscription', 'Software Instance'):
raise TypeError('%s type is not supported' % self.getPortalType())
if 'root_software_release_url' in self.__dict__:
self.url_string = self.root_software_release_url
delattr(self, 'root_software_release_url')
real(self)
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="PythonScript" module="Products.PythonScripts.PythonScript"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>Script_magic</string> </key>
<value> <int>3</int> </value>
</item>
<item>
<key> <string>_bind_names</string> </key>
<value>
<object>
<klass>
<global name="NameAssignments" module="Shared.DC.Scripts.Bindings"/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key> <string>_asgns</string> </key>
<value>
<dictionary>
<item>
<key> <string>name_container</string> </key>
<value> <string>container</string> </value>
</item>
<item>
<key> <string>name_context</string> </key>
<value> <string>context</string> </value>
</item>
<item>
<key> <string>name_m_self</string> </key>
<value> <string>script</string> </value>
</item>
<item>
<key> <string>name_subpath</string> </key>
<value> <string>traverse_subpath</string> </value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key> <string>_body</string> </key>
<value> <string>context.getPortalObject().portal_catalog.searchAndActivate(\n
portal_type=(\'Hosting Subscription\', \'Software Instance\'),\n
method_id=\'Instance_migrateRootSoftwareReleaseUrl\',\n
activate_kw={\'tag\': \'Instance_migrateRootSoftwareReleaseUrl\'}\n
)\n
\n
return \'root_software_release_url migration initiated.\'\n
</string> </value>
</item>
<item>
<key> <string>_params</string> </key>
<value> <string></string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>ERP5Site_initiateMigrateRootSoftwareReleaseUrl</string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
<?xml version="1.0"?>
<ZopeData>
<record id="1" aka="AAAAAAAAAAE=">
<pickle>
<global name="ExternalMethod" module="Products.ExternalMethod.ExternalMethod"/>
</pickle>
<pickle>
<dictionary>
<item>
<key> <string>_function</string> </key>
<value> <string>Instance_migrateRootSoftwareReleaseUrl</string> </value>
</item>
<item>
<key> <string>_module</string> </key>
<value> <string>VifibUpgrader</string> </value>
</item>
<item>
<key> <string>id</string> </key>
<value> <string>Instance_migrateRootSoftwareReleaseUrl</string> </value>
</item>
<item>
<key> <string>title</string> </key>
<value> <string></string> </value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
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