Commit d23c3231 authored by Romain Courteaud's avatar Romain Courteaud

slapos_cloud: allow to propagate a single instance

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