Commit 68ae75ce authored by Antoine Catton's avatar Antoine Catton Committed by Cédric de Saint Martin

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.

Conflicts:

	master/bt5/vifib_slap/bt/revision
parent e074e3b9
......@@ -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
......
497
\ No newline at end of file
506
\ No newline at end of file
......@@ -829,7 +829,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