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
01550c05
Commit
01550c05
authored
Nov 28, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_upgrader: if all instances are linked to the same project, move the computer to that project
parent
0a539290
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/ComputeNode_checkSiteMigrationToVirtualMaster.py
...upgrader/ComputeNode_checkSiteMigrationToVirtualMaster.py
+9
-1
No files found.
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/ComputeNode_checkSiteMigrationToVirtualMaster.py
View file @
01550c05
...
...
@@ -29,6 +29,7 @@ not_migrated_compute_node_dict[compute_node_relative_url] = not_migrated_compute
partition_list
=
compute_node
.
contentValues
(
portal_type
=
'Compute Partition'
)
instance_tree_list
=
[]
for
partition
in
partition_list
:
instance_list
=
portal
.
portal_catalog
(
portal_type
=
[
'Slave Instance'
,
'Software Instance'
],
...
...
@@ -59,7 +60,9 @@ elif not_migrated_compute_node['project_relative_url'] is not None:
else
:
# If the related instance are all grouped on this machine, and from the same user
from_same_user_only
=
True
instance_project_list
=
[]
for
instance_tree
in
instance_tree_list
:
instance_project_list
.
append
(
instance_tree
.
getFollowUp
(
None
))
if
instance_tree
.
getDestinationSection
()
!=
not_migrated_compute_node
[
'source_administration'
]:
from_same_user_only
=
False
else
:
...
...
@@ -67,11 +70,16 @@ else:
partition
=
software_instance
.
getAggregate
(
None
)
if
(
partition
is
not
None
)
and
(
partition
.
startswith
(
compute_node_relative_url
)):
from_same_user_only
=
False
instance_project_list
=
list
(
set
(
instance_project_list
))
if
from_same_user_only
:
not_migrated_compute_node_dict
.
pop
(
compute_node_relative_url
)
source_administration_value
.
Person_checkSiteMigrationCreatePersonalVirtualMaster
([
compute_node_relative_url
]
+
[
x
.
getRelativeUrl
()
for
x
in
instance_tree_list
])
elif
(
len
(
instance_project_list
)
==
1
)
and
(
instance_project_list
[
0
]
is
not
None
):
# Else, check if all related instances tree are on the same virtual master
not_migrated_compute_node_dict
.
pop
(
compute_node_relative_url
)
compute_node
.
activate
().
Base_activateObjectMigrationToVirtualMaster
(
instance_project_list
[
0
])
# Log
if
not_migrated_compute_node_dict
:
...
...
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