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
913f0ef7
Commit
913f0ef7
authored
Jan 23, 2023
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slapos_pdm: drop Base_rejectUpgradeDecision
parent
584fb276
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
0 additions
and
197 deletions
+0
-197
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Base_rejectUpgradeDecision.py
...tem/portal_skins/slapos_pdm/Base_rejectUpgradeDecision.py
+0
-36
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Base_rejectUpgradeDecision.xml
...em/portal_skins/slapos_pdm/Base_rejectUpgradeDecision.xml
+0
-62
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
...ateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
+0
-99
No files found.
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Base_rejectUpgradeDecision.py
deleted
100644 → 0
View file @
584fb276
if
reference
is
None
:
raise
ValueError
(
"Missing Reference"
)
portal
=
context
.
getPortalObject
()
upgrade_decision_list
=
portal
.
portal_catalog
(
portal_type
=
"Upgrade Decision"
,
reference
=
reference
,
limit
=
2
)
if
len
(
upgrade_decision_list
)
==
0
:
return
context
.
Base_redirect
(
""
,
keep_items
=
{
"portal_status_message"
:
context
.
Base_translateString
(
"Unable to find the Upgrade Decision."
)})
if
len
(
upgrade_decision_list
)
>
1
:
raise
ValueError
(
"Duplicated reference for %s. Please contact site administrators."
%
reference
)
upgrade_decision
=
upgrade_decision_list
[
0
]
if
upgrade_decision
.
getSimulationState
()
in
[
'cancelled'
,
'rejected'
]:
message
=
"Upgrade Decision is already Rejected!"
elif
upgrade_decision
.
getSimulationState
()
==
'started'
:
message
=
"Sorry, This Upgrade Decision is already Started, you cannot reject it anymore."
elif
upgrade_decision
.
getSimulationState
()
in
[
'stopped'
,
'delivered'
]:
message
=
"Sorry, this Upgrade Decision has been already processed."
elif
upgrade_decision
.
getSimulationState
()
in
[
'confirmed'
,
'draft'
,
'planned'
]:
message
=
"Thanks Upgrade Decision has been rejected Successfully (You cannot use it anymore)."
upgrade_decision
.
reject
()
return
context
.
Base_redirect
(
""
,
keep_items
=
{
"portal_status_message"
:
context
.
Base_translateString
(
message
)})
master/bt5/slapos_pdm/SkinTemplateItem/portal_skins/slapos_pdm/Base_rejectUpgradeDecision.xml
deleted
100644 → 0
View file @
584fb276
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"_reconstructor"
module=
"copy_reg"
/>
</klass>
<tuple>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
<global
name=
"object"
module=
"__builtin__"
/>
<none/>
</tuple>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
reference
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
Base_rejectUpgradeDecision
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_pdm/TestTemplateItem/portal_components/test.erp5.testSlapOSPDMSkins.py
View file @
913f0ef7
...
...
@@ -489,105 +489,6 @@ class TestSlapOSPDMSkins(TestSlapOSPDMMixinSkins):
self
.
assertEqual
(
len
(
upgrade_decision2
),
0
)
self
.
assertEqual
(
upgrade_decision
.
getSimulationState
(),
'started'
)
def
test_tocheckBase_rejectUpgradeDecision_no_reference
(
self
):
self
.
_makeUpgradeDecision
()
self
.
assertRaises
(
ValueError
,
self
.
portal
.
Base_rejectUpgradeDecision
,
None
)
def
test_tocheckBase_rejectUpgradeDecision_no_upgrade_decision
(
self
):
redirect_url
=
self
.
portal
.
Base_rejectUpgradeDecision
(
'UD-UNEXISTING'
)
self
.
assertTrue
(
redirect_url
.
endswith
(
"?portal_status_message=Unable%20to%20find%20the%20Upgrade%20Decision."
),
"%s contains the wrong message"
%
redirect_url
)
def
test_tocheckBase_rejectUpgradeDecision_draft_upgrade_decision
(
self
):
upgrade_decision
=
self
.
_makeUpgradeDecision
()
upgrade_decision
.
setReference
(
"UD-TESTDRAFT"
)
self
.
tic
()
redirect_url
=
self
.
portal
.
Base_rejectUpgradeDecision
(
'UD-TESTDRAFT'
)
self
.
assertTrue
(
redirect_url
.
endswith
(
"?portal_status_message=Thanks%20Upgrade%20Decision%20has%20been"
\
"%20rejected%20Successfully%20%28You%20cannot%20use%20it%20anymore%29."
),
"%s contains the wrong message"
%
redirect_url
)
self
.
assertEqual
(
upgrade_decision
.
getSimulationState
(),
'rejected'
)
def
test_tocheckBase_rejectUpgradeDecision_planned_upgrade_decision
(
self
):
upgrade_decision
=
self
.
_makeUpgradeDecision
()
upgrade_decision
.
setReference
(
"UD-TESTPLANNED"
)
upgrade_decision
.
plan
()
self
.
tic
()
redirect_url
=
self
.
portal
.
Base_rejectUpgradeDecision
(
'UD-TESTPLANNED'
)
self
.
assertTrue
(
redirect_url
.
endswith
(
"?portal_status_message=Thanks%20Upgrade%20Decision%20has%20been"
\
"%20rejected%20Successfully%20%28You%20cannot%20use%20it%20anymore%29."
),
"%s contains the wrong message"
%
redirect_url
)
self
.
assertEqual
(
upgrade_decision
.
getSimulationState
(),
'rejected'
)
def
test_tocheckBase_rejectUpgradeDecision_confirmed_upgrade_decision
(
self
):
upgrade_decision
=
self
.
_makeUpgradeDecision
()
upgrade_decision
.
setReference
(
"UD-TESTCONFIRMED"
)
upgrade_decision
.
confirm
()
self
.
tic
()
redirect_url
=
self
.
portal
.
Base_rejectUpgradeDecision
(
'UD-TESTCONFIRMED'
)
self
.
assertTrue
(
redirect_url
.
endswith
(
"?portal_status_message=Thanks%20Upgrade%20Decision%20has%20been"
\
"%20rejected%20Successfully%20%28You%20cannot%20use%20it%20anymore%29."
),
"%s contains the wrong message"
%
redirect_url
)
self
.
assertEqual
(
upgrade_decision
.
getSimulationState
(),
'rejected'
)
def
test_tocheckBase_rejectUpgradeDecision_started_decision
(
self
):
upgrade_decision
=
self
.
_makeUpgradeDecision
()
upgrade_decision
.
setReference
(
"UD-TESTSTARTED"
)
upgrade_decision
.
start
()
self
.
tic
()
redirect_url
=
self
.
portal
.
Base_rejectUpgradeDecision
(
'UD-TESTSTARTED'
)
self
.
assertTrue
(
redirect_url
.
endswith
(
"?portal_status_message=Sorry%2C%20This%20Upgrade%20Decision%20is%20"
\
"already%20Started%2C%20you%20cannot%20reject%20it%20anymore."
),
"%s contains the wrong message"
%
redirect_url
)
def
test_tocheckBase_rejectUpgradeDecision_stop_decision
(
self
):
upgrade_decision
=
self
.
_makeUpgradeDecision
()
upgrade_decision
.
setReference
(
"UD-TESTSTOP"
)
upgrade_decision
.
start
()
upgrade_decision
.
stop
()
self
.
tic
()
redirect_url
=
self
.
portal
.
Base_rejectUpgradeDecision
(
'UD-TESTSTOP'
)
self
.
assertTrue
(
redirect_url
.
endswith
(
"?portal_status_message=Sorry%2C%20this%20Upgrade%20Decision%20has%20been%20already%20processed."
),
"%s contains the wrong message"
%
redirect_url
)
def
test_tocheckBase_rejectUpgradeDecision_delivered_decision
(
self
):
upgrade_decision
=
self
.
_makeUpgradeDecision
()
upgrade_decision
.
setReference
(
"UD-TESTDELIVERED"
)
upgrade_decision
.
start
()
upgrade_decision
.
stop
()
upgrade_decision
.
deliver
()
self
.
tic
()
redirect_url
=
self
.
portal
.
Base_rejectUpgradeDecision
(
'UD-TESTDELIVERED'
)
self
.
assertTrue
(
redirect_url
.
endswith
(
"?portal_status_message=Sorry%2C%20this%20Upgrade%20Decision%20has%20been%20already%20processed."
),
"%s contains the wrong message"
%
redirect_url
)
def
test_tocheckBase_rejectUpgradeDecision_cancelled_decision
(
self
):
upgrade_decision
=
self
.
_makeUpgradeDecision
()
upgrade_decision
.
setReference
(
"UD-TESTCANCELLED"
)
upgrade_decision
.
cancel
()
self
.
tic
()
redirect_url
=
self
.
portal
.
Base_rejectUpgradeDecision
(
'UD-TESTCANCELLED'
)
self
.
assertTrue
(
redirect_url
.
endswith
(
"?portal_status_message=Upgrade%20Decision%20is%20already%20Rejected%21"
),
"%s contains the wrong message"
%
redirect_url
)
def
test_tocheckBase_rejectUpgradeDecision_reject_decision
(
self
):
upgrade_decision
=
self
.
_makeUpgradeDecision
()
upgrade_decision
.
setReference
(
"UD-TESTREJECT"
)
upgrade_decision
.
reject
()
self
.
tic
()
redirect_url
=
self
.
portal
.
Base_rejectUpgradeDecision
(
'UD-TESTREJECT'
)
self
.
assertTrue
(
redirect_url
.
endswith
(
"?portal_status_message=Upgrade%20Decision%20is%20already%20Rejected%21"
),
"%s contains the wrong message"
%
redirect_url
)
def
test_tocheckUpgradeDecision_isUpgradeFinished_compute_node
(
self
):
project
=
self
.
addProject
()
compute_node
,
_
=
self
.
_makeComputeNode
(
project
)
...
...
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