Commit 22e68568 authored by Antoine Catton's avatar Antoine Catton

Add the ability to get the matching slave instance.

Warning: if you thought that Romain's hack was dirty, this
is worse. Anyway, this could suffer from having several
slave instance with the same title. Be aware.
parent 1e012c01
No related merge requests found
......@@ -85,7 +85,8 @@ if software_instance is not None and computer_partition is not None and software
if instance is None:\n
raise NotImplementedError, "Unexpected Sale Packing List without Instance aggregated %s" % sale_packing_list_line.getRelativeUrl()\n
elif instance.getPortalType() == "Slave Instance":\n
slave_instance = dict(slap_software_type=instance.getSourceReference(),\n
slave_instance = dict(slave_title=instance.getTitle(),\n
slap_software_type=instance.getSourceReference(),\n
slave_reference=instance.getReference(),\n
xml=instance.getTextContent(),\n
connection_xml=instance.getConnectionXml(),\n
......
505
\ No newline at end of file
506
\ No newline at end of file
......@@ -849,7 +849,10 @@ class SlapTool(BaseTool):
software_instance = SoftwareInstance(**parameter_dict)
if shared:
slave_instance = parameter_dict.get("slave_instance_list")[0]
# XXX: Dirty hack
for slave_instance in parameter_dict.get("slave_instance_list", []):
if slave_instance['slave_title'] == partition_reference:
break
software_instance._parameter_dict = self._instanceXmlToDict(
slave_instance.pop('xml'))
software_instance._connection_dict = self._instanceXmlToDict(
......
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