Commit c4ad2dde authored by Romain Courteaud's avatar Romain Courteaud

slapos_upgrader: migrate more properties on compute node

parent 60bf51f6
...@@ -7,10 +7,23 @@ portal = context.getPortalObject() ...@@ -7,10 +7,23 @@ portal = context.getPortalObject()
compute_node = context compute_node = context
project = portal.restrictedTraverse(project_relative_url) project = portal.restrictedTraverse(project_relative_url)
edit_kw = {}
# Check if it has been migrated first # Check if it has been migrated first
if compute_node.getFollowUpValue() is not None: if compute_node.getFollowUpValue() is None:
return edit_kw['follow_up_value'] = project
if compute_node.getAllocationScope('').startswith('open/'):
edit_kw['allocation_scope'] = 'open'
# Migrate # Migrate
# Compute Node only need a link on itself. if edit_kw:
compute_node.edit(follow_up_value=project) compute_node.edit(**edit_kw)
# Drop outdated categories
category_list = compute_node.getCategoryList()
new_category_list = [x for x in category_list if not x.startswith('source_administration')]
if len(category_list) != len(new_category_list):
compute_node.setCategoryList(new_category_list)
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