Commit d23c3231 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: allow to propagate a single instance

parent 2c2f83cb
......@@ -11,7 +11,8 @@ assert remote_node.getPortalType() == 'Remote Node'
remote_project = remote_node.getDestinationProjectValue(portal_type='Project')
remote_person = remote_node.getDestinationSectionValue(portal_type='Person')
if compute_partition.getId() == 'SHARED_REMOTE':
if local_instance_list is None:
if compute_partition.getId() == 'SHARED_REMOTE':
# Hardcoded ID behaviour
local_instance_list = portal.portal_catalog(
portal_type='Slave Instance',
......@@ -19,14 +20,17 @@ if compute_partition.getId() == 'SHARED_REMOTE':
validation_state='validated'
)
else:
else:
local_instance_list = portal.portal_catalog(
portal_type='Software Instance',
aggregate__uid=compute_partition.getUid(),
validation_state='validated'
)
else:
local_instance_list = [portal.restrictedTraverse(x) for x in local_instance_list]
for local_instance in local_instance_list:
assert local_instance.getAggregate() == compute_partition.getRelativeUrl()
# If local instance destruction has been propagated, do nothing
if local_instance.getValidationState() != 'validated':
......
......@@ -50,7 +50,7 @@
</item>
<item>
<key> <string>_params</string> </key>
<value> <string>activate_kw=None, REQUEST=None</string> </value>
<value> <string>local_instance_list=None, activate_kw=None, REQUEST=None</string> </value>
</item>
<item>
<key> <string>id</string> </key>
......
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