Commit 1aa97e7d authored by Gabriel Monnerat's avatar Gabriel Monnerat

remove checkPermission because is not used and add the reference of each Slave...

remove checkPermission because is not used and add the reference of each Slave Instance. The reference is used to generated the key to access it
parent 99b21587
...@@ -50,12 +50,11 @@ ...@@ -50,12 +50,11 @@
</item> </item>
<item> <item>
<key> <string>_body</string> </key> <key> <string>_body</string> </key>
<value> <string>checkPermission = context.getPortalObject().portal_membership.checkPermission\n <value> <string>sale_packing_list_line = context\n
sale_packing_list_line = context\n
instance_type_list = [\'Software Instance\', \'Slave Instance\']\n instance_type_list = [\'Software Instance\', \'Slave Instance\']\n
software_instance = sale_packing_list_line.getAggregateValue(portal_type=instance_type_list)\n software_instance = sale_packing_list_line.getAggregateValue(portal_type=instance_type_list)\n
computer_partition = sale_packing_list_line.getAggregateValue(portal_type=\'Computer Partition\')\n computer_partition = sale_packing_list_line.getAggregateValue(portal_type=\'Computer Partition\')\n
software_release = sale_packing_list_line.getAggregateValue(portal_type=\'Software Release\')\n software_release = sale_packing_list_line.getAggregateValue(portal_type="Software Release")\n
ip_list = []\n ip_list = []\n
if computer_partition.getPortalType() == \'Computer Partition\':\n if computer_partition.getPortalType() == \'Computer Partition\':\n
for internet_protocol_address in computer_partition.contentValues(portal_type=\'Internet Protocol Address\'):\n for internet_protocol_address in computer_partition.contentValues(portal_type=\'Internet Protocol Address\'):\n
...@@ -68,10 +67,13 @@ if software_instance is not None and computer_partition is not None and software ...@@ -68,10 +67,13 @@ if software_instance is not None and computer_partition is not None and software
if instance is None:\n if instance is None:\n
continue\n continue\n
elif instance.getPortalType() == "Slave Instance":\n elif instance.getPortalType() == "Slave Instance":\n
slave_instance_list.append(dict(slap_software_type=instance.getSourceReference(),\n slave_instance = dict(slap_software_type=instance.getSourceReference(),\n
xml=instance.getTextContent(),\n slave_reference=instance.getReference(),\n
connection_xml=instance.getConnectionXml(),\n xml=instance.getTextContent(),\n
))\n connection_xml=instance.getConnectionXml(),\n
)\n
if slave_instance not in slave_instance_list:\n
slave_instance_list.append(slave_instance)\n
elif instance.getPortalType() == "Software Instance":\n elif instance.getPortalType() == "Software Instance":\n
software_instance = instance\n software_instance = instance\n
return {\n return {\n
...@@ -82,7 +84,7 @@ if software_instance is not None and computer_partition is not None and software ...@@ -82,7 +84,7 @@ if software_instance is not None and computer_partition is not None and software
\'slap_software_type\': software_instance.getSourceReference(),\n \'slap_software_type\': software_instance.getSourceReference(),\n
\'slap_software_release_url\':software_release.getUrlString(),\n \'slap_software_release_url\':software_release.getUrlString(),\n
\'slap_server_url\':context.getPortalObject().portal_slap.absolute_url(),\n \'slap_server_url\':context.getPortalObject().portal_slap.absolute_url(),\n
\'slave_instance_list\':slave_instance_list,\n \'slave_instance_list\': slave_instance_list,\n
\'ip_list\':ip_list,\n \'ip_list\':ip_list,\n
}\n }\n
\n \n
......
397 398
\ 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