Commit 60bf51f6 authored by Romain Courteaud's avatar Romain Courteaud

slapos_upgrader: lint

parent 6f3453c1
......@@ -4,8 +4,6 @@ if REQUEST is not None:
raise Unauthorized
not_migrated_compute_node_dict = {}
personal_virtual_master_dict = {}
existing_virtual_master_dict = {}
portal = context.getPortalObject()
compute_node = context.getObject()
......@@ -48,25 +46,13 @@ instance_tree_list = list(set(instance_tree_list))
if (len(not_migrated_compute_node['instance_list']) == 0) and \
(not_migrated_compute_node['project_relative_url'] is None) and \
((not not_migrated_compute_node['allocation_scope'].startswith('open')) or (not_migrated_compute_node['allocation_scope'] == 'open/personal')):
# print 'Personal: %s' % compute_node_relative_url
if not_migrated_compute_node['source_administration'] not in personal_virtual_master_dict:
personal_virtual_master_dict[not_migrated_compute_node['source_administration']] = {
'compute_node_list': [],
'instance_tree_list': []
}
personal_virtual_master_dict[not_migrated_compute_node['source_administration']]['compute_node_list'].append(compute_node_relative_url)
not_migrated_compute_node_dict.pop(compute_node_relative_url)
not_migrated_compute_node_dict.pop(compute_node_relative_url)
source_administration_value.Person_checkSiteMigrationCreatePersonalVirtualMaster([compute_node_relative_url])
# Node linked to a project
elif not_migrated_compute_node['project_relative_url'] is not None:
if not_migrated_compute_node['project_relative_url'] not in existing_virtual_master_dict:
existing_virtual_master_dict[not_migrated_compute_node['project_relative_url']] = {
'compute_node_list': [],
'instance_tree_list': []
}
existing_virtual_master_dict[not_migrated_compute_node['project_relative_url']]['compute_node_list'].append(compute_node_relative_url)
not_migrated_compute_node_dict.pop(compute_node_relative_url)
......
......@@ -4,8 +4,6 @@ if REQUEST is not None:
raise Unauthorized
not_migrated_instance_tree_dict = {}
personal_virtual_master_dict = {}
existing_virtual_master_dict = {}
portal = context.getPortalObject()
instance_tree = context.getObject()
......@@ -34,10 +32,4 @@ if (not_migrated_instance_tree_dict[instance_tree_relative_url]['slap_state'] ==
(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):
if not_migrated_instance_tree_dict[instance_tree_relative_url]['destination_section'] not in personal_virtual_master_dict:
personal_virtual_master_dict[not_migrated_instance_tree_dict[instance_tree_relative_url]['destination_section']] = {
'compute_node_list': [],
'instance_tree_list': []
}
personal_virtual_master_dict[not_migrated_instance_tree_dict[instance_tree_relative_url]['destination_section']]['instance_tree_list'].append(instance_tree_relative_url)
not_migrated_instance_tree_dict.pop(instance_tree_relative_url)
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