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
0
Merge Requests
0
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
Titouan Soulard
slapos.core
Commits
7cc09afd
Commit
7cc09afd
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
b6ef63ce
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 @
7cc09afd
...
...
@@ -42,14 +42,15 @@ root_instance_list = [
if
q
.
getSlapState
()
!=
'destroy_requested'
]
if
len
(
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
()
if
partition
is
not
None
:
compute_node
=
partition
.
getParentValue
()
if
(
root_instance
.
getPortalType
()
==
'Slave Instance'
)
and
\
(
compute_node
.
getPortalType
()
!=
'Remote Node'
):
return
person
=
context
.
getDestinationSectionValue
()
if
person
is
None
:
return
...
...
@@ -65,6 +66,10 @@ allocation_cell_list = software_product.getFollowUpValue().Project_getSoftwarePr
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)
if
len
(
allocation_cell_list
)
==
1
:
if
(
allocation_cell_list
[
0
].
getSoftwareReleaseValue
().
getUrlString
()
!=
instance_tree
.
getUrlString
()):
...
...
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMCreateUpgradeDecisionSkins.py
View file @
7cc09afd
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