Commit 1d0eeff8 authored by Romain Courteaud's avatar Romain Courteaud

slapos_upgrader: migrate instance tree linked to an existing project

parent 6fab175c
...@@ -26,9 +26,15 @@ for sql_instance in portal.portal_catalog(specialise__uid=instance_tree.getUid() ...@@ -26,9 +26,15 @@ for sql_instance in portal.portal_catalog(specialise__uid=instance_tree.getUid()
if not ((sql_instance.getAggregate(None) is None) and (sql_instance.getValidationState() == 'invalidated')): if not ((sql_instance.getAggregate(None) is None) and (sql_instance.getValidationState() == 'invalidated')):
not_migrated_instance_tree_dict[instance_tree_relative_url]['alive_instance_list'].append(sql_instance.getRelativeUrl()) not_migrated_instance_tree_dict[instance_tree_relative_url]['alive_instance_list'].append(sql_instance.getRelativeUrl())
# Node linked to a project
if not_migrated_instance_tree_dict[instance_tree_relative_url]['project_relative_url'] is not None:
instance_tree.activate().Base_activateObjectMigrationToVirtualMaster(not_migrated_instance_tree_dict[instance_tree_relative_url]['project_relative_url'])
not_migrated_instance_tree_dict.pop(instance_tree_relative_url)
# Outdated instance tree will move to the personal project # Outdated instance tree will move to the personal project
# as, there is no way to know where it has been allocated previously # as, there is no way to know where it has been allocated previously
if (not_migrated_instance_tree_dict[instance_tree_relative_url]['slap_state'] == 'destroy_requested') and \ elif (not_migrated_instance_tree_dict[instance_tree_relative_url]['slap_state'] == 'destroy_requested') and \
(len(not_migrated_instance_tree_dict[instance_tree_relative_url]['alive_instance_list']) == 0) and \ (len(not_migrated_instance_tree_dict[instance_tree_relative_url]['alive_instance_list']) == 0) and \
(not_migrated_instance_tree_dict[instance_tree_relative_url]['project_relative_url'] is None) and \ (not_migrated_instance_tree_dict[instance_tree_relative_url]['project_relative_url'] is None) and \
(not_migrated_instance_tree_dict[instance_tree_relative_url]['destination_section'] is not None): (not_migrated_instance_tree_dict[instance_tree_relative_url]['destination_section'] is not None):
......
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