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
31e21a61
Commit
31e21a61
authored
Aug 26, 2024
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_upgrader: do not return too early
parent
3a1e44a4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
13 deletions
+16
-13
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/InstanceTree_fixupSiteMigrationToVirtualMaster.py
...pgrader/InstanceTree_fixupSiteMigrationToVirtualMaster.py
+16
-13
No files found.
master/bt5/slapos_upgrader/SkinTemplateItem/portal_skins/slapos_upgrader/InstanceTree_fixupSiteMigrationToVirtualMaster.py
View file @
31e21a61
...
@@ -28,6 +28,8 @@ if root_software_instance is not None:
...
@@ -28,6 +28,8 @@ if root_software_instance is not None:
root_instance_virtual_master_relative_url
=
root_partition
.
getParentValue
().
getFollowUp
(
None
)
root_instance_virtual_master_relative_url
=
root_partition
.
getParentValue
().
getFollowUp
(
None
)
if
((
root_instance_virtual_master_relative_url
is
not
None
)
and
if
((
root_instance_virtual_master_relative_url
is
not
None
)
and
(
root_instance_virtual_master_relative_url
!=
instance_tree_virtual_master_relative_url
)):
(
root_instance_virtual_master_relative_url
!=
instance_tree_virtual_master_relative_url
)):
instance_tree_migration_needed
=
True
# ensure no software instance is not on the instance tree
# ensure no software instance is not on the instance tree
# virtual master. If so, keep the instance tree virtual master
# virtual master. If so, keep the instance tree virtual master
for
sql_result
in
portal
.
portal_catalog
(
for
sql_result
in
portal
.
portal_catalog
(
...
@@ -39,20 +41,21 @@ if root_software_instance is not None:
...
@@ -39,20 +41,21 @@ if root_software_instance is not None:
if
instance_partition
is
not
None
:
if
instance_partition
is
not
None
:
instance_virtual_master_relative_url
=
instance_partition
.
getParentValue
().
getFollowUp
(
None
)
instance_virtual_master_relative_url
=
instance_partition
.
getParentValue
().
getFollowUp
(
None
)
if
(
instance_virtual_master_relative_url
==
instance_tree_virtual_master_relative_url
):
if
(
instance_virtual_master_relative_url
==
instance_tree_virtual_master_relative_url
):
return
instance_tree_migration_needed
=
False
edit_kw
=
{
'follow_up_value'
:
None
}
if
instance_tree_migration_needed
:
activate_kw
=
{
'tag'
:
tag
}
edit_kw
=
{
'follow_up_value'
:
None
}
instance_tree
.
edit
(
**
edit_kw
)
activate_kw
=
{
'tag'
:
tag
}
instance_tree
.
reindexObject
(
activate_kw
=
activate_kw
)
instance_tree
.
edit
(
**
edit_kw
)
for
sql_result
in
portal
.
portal_catalog
(
instance_tree
.
reindexObject
(
activate_kw
=
activate_kw
)
specialise__uid
=
instance_tree
.
getUid
(),
for
sql_result
in
portal
.
portal_catalog
(
portal_type
=
[
'Software Instance'
,
'Slave Instance'
]
specialise__uid
=
instance_tree
.
getUid
(),
):
portal_type
=
[
'Software Instance'
,
'Slave Instance'
]
instance
=
sql_result
.
getObject
()
):
instance
.
edit
(
**
edit_kw
)
instance
=
sql_result
.
getObject
()
instance
.
reindexObject
(
activate_kw
=
activate_kw
)
instance
.
edit
(
**
edit_kw
)
return
instance
.
reindexObject
(
activate_kw
=
activate_kw
)
return
#######################################################################
#######################################################################
# If instance is not allocated on the same virtual master than instance tree
# If instance is not allocated on the same virtual master than instance tree
...
...
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