Commit 45d96643 authored by Łukasz Nowak's avatar Łukasz Nowak

Re-enable slave_instance_list code.

Narrow to only return Slave Instance related delivery lines.
parent 98df019f
...@@ -50,7 +50,8 @@ ...@@ -50,7 +50,8 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>sale_packing_list_line = context\n <value> <string>from Products.ZSQLCatalog.SQLCatalog import Query, NegatedQuery, ComplexQuery\n
sale_packing_list_line = context\n
instance_type_list = [\'Software Instance\', \'Slave Instance\']\n instance_type_list = [\'Software Instance\', \'Slave Instance\']\n
\n \n
hosting_service = context.restrictedTraverse(\n hosting_service = context.restrictedTraverse(\n
...@@ -75,26 +76,25 @@ if computer_partition.getPortalType() == \'Computer Partition\':\n ...@@ -75,26 +76,25 @@ if computer_partition.getPortalType() == \'Computer Partition\':\n
if software_instance is not None and computer_partition is not None and software_release is not None:\n if software_instance is not None and computer_partition is not None and software_release is not None:\n
slave_instance_list = []\n slave_instance_list = []\n
\n \n
# sale_packing_list_line_list = computer_partition.portal_catalog(\n sale_packing_list_line_list = computer_partition.portal_catalog(\n
# aggregate_uid=computer_partition.getUid(),\n aggregate_uid=computer_partition.getUid(),\n
# portal_type="Sale Packing List Line",\n aggregate_portal_type=\'Slave Instance\',\n
# simulation_state=state_list,\n portal_type="Sale Packing List Line",\n
# default_resource_uid=service_uid_list)\n simulation_state=state_list,\n
# for sale_packing_list_line in sale_packing_list_line_list:\n default_resource_uid=service_uid_list)\n
# instance = sale_packing_list_line.getAggregateValue(portal_type=instance_type_list)\n \n
# if instance is None:\n for sale_packing_list_line in sale_packing_list_line_list:\n
# raise NotImplementedError, "Unexpected Sale Packing List without Instance aggregated %s" % sale_packing_list_line.getRelativeUrl()\n instance = sale_packing_list_line.getAggregateValue(portal_type=\'Slave Instance\')\n
# elif instance.getPortalType() == "Slave Instance":\n if instance.getUid() == software_instance.getUid():\n
# slave_instance = dict(slave_title=instance.getTitle(),\n # ignore self\n
# slap_software_type=instance.getSourceReference(),\n continue\n
# slave_reference=instance.getReference(),\n slave_instance = dict(slave_title=instance.getTitle(),\n
# xml=instance.getTextContent(),\n slap_software_type=instance.getSourceReference(),\n
# connection_xml=instance.getConnectionXml(),\n slave_reference=instance.getReference(),\n
# )\n xml=instance.getTextContent(),\n
# if slave_instance not in slave_instance_list:\n connection_xml=instance.getConnectionXml(),\n
# slave_instance_list.append(slave_instance)\n )\n
# elif instance.getPortalType() == "Software Instance":\n slave_instance_list.append(slave_instance)\n
# software_instance = instance\n
return {\n return {\n
\'xml\':software_instance.getTextContent(),\n \'xml\':software_instance.getTextContent(),\n
\'connection_xml\':software_instance.getConnectionXml(),\n \'connection_xml\':software_instance.getConnectionXml(),\n
......
660 661
\ 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