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
Labels
Merge Requests
18
Merge Requests
18
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
slapos.core
Commits
d023bb2f
Commit
d023bb2f
authored
Jul 14, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_pdm: Clean up Upgrade decisions on draft and planned also
This can prevent a useless message be pushed to the user.
parent
84616c70
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Alarm_cancelUpgradeDecision.py
...em/portal_skins/slapos_pdm/Alarm_cancelUpgradeDecision.py
+1
-1
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecisionLine_cancel.py
...tem/portal_skins/slapos_pdm/UpgradeDecisionLine_cancel.py
+7
-1
No files found.
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Alarm_cancelUpgradeDecision.py
View file @
d023bb2f
...
...
@@ -3,7 +3,7 @@ portal = context.getPortalObject()
portal
.
portal_catalog
.
searchAndActivate
(
portal_type
=
"Upgrade Decision Line"
,
simulation_state
=
"confirmed"
,
simulation_state
=
[
"confirmed"
,
"draft"
,
"planned"
]
,
method_id
=
'UpgradeDecisionLine_cancel'
,
activate_kw
=
{
'tag'
:
tag
}
)
...
...
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/UpgradeDecisionLine_cancel.py
View file @
d023bb2f
...
...
@@ -9,6 +9,9 @@ if software_release.getValidationState() == "archived":
return
if
hosting_subscription
is
not
None
:
if
hosting_subscription
.
getUpgradeScope
()
in
[
'never'
,
'disabled'
]:
upgrade_decision
.
cancel
(
"Upgrade scope was disabled on the related Hosting Subscription"
)
if
hosting_subscription
.
getSlapState
()
==
"destroy_requested"
:
upgrade_decision
.
cancel
(
comment
=
"Hosting Subscription is destroyed."
)
...
...
@@ -19,6 +22,9 @@ if hosting_subscription is not None:
computer
=
context
.
getAggregateValue
(
portal_type
=
"Computer"
)
if
computer
is
not
None
:
if
computer
.
getUpgradeScope
()
in
[
'never'
,
'disabled'
]:
upgrade_decision
.
cancel
(
"Upgrade scope was disabled on the related Hosting Subscription"
)
if
computer
.
getAllocationScope
()
in
[
"closed/forever"
,
"closed/termination"
]:
upgrade_decision
.
cancel
(
comment
=
"Computer is closed."
)
return
...
...
@@ -28,4 +34,4 @@ if computer is not None:
parent_reference
=
computer
.
getReference
(),
software_release_url
=
software_release
.
getUrlString
()))
if
already_deployed
:
context
.
getParentValue
()
.
cancel
(
comment
=
"Computer already has the software release"
)
upgrade_decision
.
cancel
(
comment
=
"Computer already has the software release"
)
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