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
c78fce70
Commit
c78fce70
authored
Jan 20, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_pdm: upgrade not allocated or allocated on remote slave instances
parent
c864efa7
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
149 additions
and
15 deletions
+149
-15
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/InstanceTree_createUpgradeDecision.py
...al_skins/slapos_pdm/InstanceTree_createUpgradeDecision.py
+9
-4
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins.py
...ents/test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins.py
+140
-11
No files found.
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/InstanceTree_createUpgradeDecision.py
View file @
c78fce70
...
@@ -42,14 +42,15 @@ root_instance_list = [
...
@@ -42,14 +42,15 @@ root_instance_list = [
if
q
.
getSlapState
()
!=
'destroy_requested'
]
if
q
.
getSlapState
()
!=
'destroy_requested'
]
if
len
(
root_instance_list
)
!=
0
:
if
len
(
root_instance_list
)
!=
0
:
root_instance
=
root_instance_list
[
0
]
root_instance
=
root_instance_list
[
0
]
if
root_instance
.
getPortalType
()
==
'Slave Instance'
:
# XXX do not upgrade Slave Instance for now
# should check Instance Node or allocation on same tree
return
partition
=
root_instance
.
getAggregateValue
()
partition
=
root_instance
.
getAggregateValue
()
if
partition
is
not
None
:
if
partition
is
not
None
:
compute_node
=
partition
.
getParentValue
()
compute_node
=
partition
.
getParentValue
()
if
(
root_instance
.
getPortalType
()
==
'Slave Instance'
)
and
\
(
compute_node
.
getPortalType
()
!=
'Remote Node'
):
return
person
=
context
.
getDestinationSectionValue
()
person
=
context
.
getDestinationSectionValue
()
if
person
is
None
:
if
person
is
None
:
return
return
...
@@ -65,6 +66,10 @@ allocation_cell_list = software_product.getFollowUpValue().Project_getSoftwarePr
...
@@ -65,6 +66,10 @@ allocation_cell_list = software_product.getFollowUpValue().Project_getSoftwarePr
predicate_portal_type
=
'Allocation Supply Cell'
predicate_portal_type
=
'Allocation Supply Cell'
)
)
if
(
root_instance
.
getPortalType
()
==
'Slave Instance'
)
and
\
(
compute_node
is
None
):
allocation_cell_list
=
[
x
for
x
in
allocation_cell_list
if
(
"Remote Node"
in
[
y
.
getPortalType
()
for
y
in
x
.
getParentValue
().
getParentValue
().
getAggregateValueList
()])]
# Only upgrade if there is no doubt (ie, only 1 url is allowed)
# Only upgrade if there is no doubt (ie, only 1 url is allowed)
if
len
(
allocation_cell_list
)
==
1
:
if
len
(
allocation_cell_list
)
==
1
:
if
(
allocation_cell_list
[
0
].
getSoftwareReleaseValue
().
getUrlString
()
!=
instance_tree
.
getUrlString
()):
if
(
allocation_cell_list
[
0
].
getSoftwareReleaseValue
().
getUrlString
()
!=
instance_tree
.
getUrlString
()):
...
...
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins.py
View file @
c78fce70
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