Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.core
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos.core
Commits
c4ad2dde
Commit
c4ad2dde
authored
1 year ago
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_upgrader: migrate more properties on compute node
parent
60bf51f6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
4 deletions
+17
-4
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/ComputeNode_triggerObjectMigrationToVirtualMaster.py
...ader/ComputeNode_triggerObjectMigrationToVirtualMaster.py
+17
-4
No files found.
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/ComputeNode_triggerObjectMigrationToVirtualMaster.py
View file @
c4ad2dde
...
...
@@ -7,10 +7,23 @@ portal = context.getPortalObject()
compute_node
=
context
project
=
portal
.
restrictedTraverse
(
project_relative_url
)
edit_kw
=
{}
# Check if it has been migrated first
if
compute_node
.
getFollowUpValue
()
is
not
None
:
return
if
compute_node
.
getFollowUpValue
()
is
None
:
edit_kw
[
'follow_up_value'
]
=
project
if
compute_node
.
getAllocationScope
(
''
).
startswith
(
'open/'
):
edit_kw
[
'allocation_scope'
]
=
'open'
# Migrate
# Compute Node only need a link on itself.
compute_node
.
edit
(
follow_up_value
=
project
)
if
edit_kw
:
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
)
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment