Commit 73c42017 authored by Vivien Alger's avatar Vivien Alger

Mass Upgrade: Upgraded tests and small refactoring

parent 8500e7ad
...@@ -50,26 +50,30 @@ ...@@ -50,26 +50,30 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>person = context.getDestinationSectionValue(portal_type="Person")\n <value> <string>instance = context.getAggregateRelatedValue()\n
\n \n
status = context.getSlapState()\n if instance is not None:\n
host_sub = instance.getSpecialiseValue()\n
person = host_sub.getDestinationSectionValue(portal_type="Person")\n
\n \n
if status == "start_requested":\n status = host_sub.getSlapState()\n
state = "started"\n \n
elif status == "stop_requested":\n if status == "start_requested":\n
state = "stopped"\n state = "started"\n
elif status == "destroy_requested":\n elif status == "stop_requested":\n
state = "destroyed"\n state = "stopped"\n
elif status == "destroy_requested":\n
state = "destroyed"\n
\n \n
person.requestSoftwareInstance(\n person.requestSoftwareInstance(\n
state=state,\n state=state,\n
software_release=new_sr_url,\n software_release=new_sr_url,\n
software_title=context.getTitle(),\n software_title=host_sub.getTitle(),\n
software_type=context.getSourceReference(),\n software_type=host_sub.getSourceReference(),\n
instance_xml=context.getTextContent(),\n instance_xml=host_sub.getTextContent(),\n
sla_xml=context.getSlaXml(),\n sla_xml=host_sub.getSlaXml(),\n
shared=context.isRootSlave()\n shared=host_sub.isRootSlave()\n
)\n )\n
</string> </value> </string> </value>
</item> </item>
<item> <item>
...@@ -78,7 +82,7 @@ person.requestSoftwareInstance(\n ...@@ -78,7 +82,7 @@ person.requestSoftwareInstance(\n
</item> </item>
<item> <item>
<key> <string>id</string> </key> <key> <string>id</string> </key>
<value> <string>HostingSubscription_changeSoftwareRelease</string> </value> <value> <string>ComputerPartition_changeHostingSubscriptionSoftwareRelease</string> </value>
</item> </item>
</dictionary> </dictionary>
</pickle> </pickle>
......
...@@ -56,18 +56,12 @@ ...@@ -56,18 +56,12 @@
old_sr_url = context.getUrlString()\n old_sr_url = context.getUrlString()\n
portal = context.getPortalObject()\n portal = context.getPortalObject()\n
\n \n
hosting_sub_list = portal.portal_catalog.searchAndActivate(\n portal.portal_catalog.searchAndActivate( \n
portal_type = \'Hosting Subscription\',\n portal_type = \'Computer Partition\',\n
default_specialise_related_uid = [x.getUid() for x in portal.portal_catalog(\n parent_reference = comp_reference_list,\n
portal_type = [\'Software Instance\', \'Slave Instance\'],\n free_for_request = 0,\n
url_string = old_sr_url,\n software_release_url = old_sr_url,\n
default_aggregate_uid = [y.getUid() for y in portal.portal_catalog(\n method_id = \'ComputerPartition_changeHostingSubscriptionSoftwareRelease\',\n
portal_type = \'Computer Partition\',\n
parent_reference = comp_reference_list,\n
free_for_request = 0\n
)]\n
)],\n
method_id = \'HostingSubscription_changeSoftwareRelease\',\n
method_kw = {\'new_sr_url\': new_sr_url},\n method_kw = {\'new_sr_url\': new_sr_url},\n
activate_kw = {\'tag\': tag}\n activate_kw = {\'tag\': tag}\n
)\n )\n
......
8 9
\ No newline at end of file \ 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