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

Mass Upgrade: Upgraded tests and small refactoring

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