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
e09ba906
Commit
e09ba906
authored
May 15, 2020
by
Thomas Gambier
Committed by
Thomas Gambier
Jul 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
SlapTool: all instances of a stopped HS are stopped
parent
fc7dd2fc
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
113 additions
and
65 deletions
+113
-65
master/bt5/slapos_slap_tool/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSSlapTool.xml
...eItem/portal_components/extension.erp5.SlapOSSlapTool.xml
+20
-17
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
...ateItem/portal_components/test.erp5.testSlapOSSlapTool.py
+35
-0
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.xml
...teItem/portal_components/test.erp5.testSlapOSSlapTool.xml
+35
-32
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapToolComputerUpdateFromDict.xml
...ts/test.erp5.testSlapOSSlapToolComputerUpdateFromDict.xml
+20
-16
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+3
-0
No files found.
master/bt5/slapos_slap_tool/ExtensionTemplateItem/portal_components/extension.erp5.SlapOSSlapTool.xml
View file @
e09ba906
...
...
@@ -100,25 +100,28 @@
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
<none/>
</tuple>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
View file @
e09ba906
...
...
@@ -1862,6 +1862,41 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
if
os
.
path
.
exists
(
self
.
instance_request_simulator
):
os
.
unlink
(
self
.
instance_request_simulator
)
def
test_request_stopped
(
self
):
self
.
_makeComplexComputer
()
self
.
instance_request_simulator
=
tempfile
.
mkstemp
()[
1
]
try
:
partition_id
=
self
.
stop_requested_software_instance
.
getAggregateValue
(
portal_type
=
'Computer Partition'
).
getReference
()
self
.
login
(
self
.
stop_requested_software_instance
.
getUserId
())
self
.
stop_requested_software_instance
.
requestInstance
=
Simulator
(
self
.
instance_request_simulator
,
'requestInstance'
)
response
=
self
.
portal_slap
.
requestComputerPartition
(
computer_id
=
self
.
computer_id
,
computer_partition_id
=
partition_id
,
software_release
=
'req_release'
,
software_type
=
'req_type'
,
partition_reference
=
'req_reference'
,
partition_parameter_xml
=
'<marshal><dictionary id="i2"/></marshal>'
,
filter_xml
=
'<marshal><dictionary id="i2"/></marshal>'
,
state
=
'<marshal><string>started</string></marshal>'
,
shared_xml
=
'<marshal><bool>0</bool></marshal>'
,
)
self
.
assertEqual
(
408
,
response
.
status
)
self
.
assertEqual
(
'private'
,
response
.
headers
.
get
(
'cache-control'
))
self
.
assertInstanceRequestSimulator
((),
{
'instance_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
'software_title'
:
'req_reference'
,
'software_release'
:
'req_release'
,
'state'
:
'stopped'
,
'sla_xml'
:
"<?xml version='1.0' encoding='utf-8'?>
\
n
<instance/>
\
n
"
,
'software_type'
:
'req_type'
,
'shared'
:
False
})
finally
:
if
os
.
path
.
exists
(
self
.
instance_request_simulator
):
os
.
unlink
(
self
.
instance_request_simulator
)
def
test_updateInstancePredecessorList
(
self
):
self
.
_makeComplexComputer
()
...
...
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.xml
View file @
e09ba906
...
...
@@ -47,21 +47,21 @@
<value>
<tuple>
<string>
W: 28, 10: Use of eval (eval-used)
</string>
<string>
W:5
37
, 13: Use of eval (eval-used)
</string>
<string>
W:
59
2, 13: Use of eval (eval-used)
</string>
<string>
W:8
29
, 13: Use of eval (eval-used)
</string>
<string>
W:14
46
, 13: Use of eval (eval-used)
</string>
<string>
W:16
4
9, 13: Use of eval (eval-used)
</string>
<string>
W:17
07
, 13: Use of eval (eval-used)
</string>
<string>
W:17
47
, 13: Use of eval (eval-used)
</string>
<string>
W:23
0
6, 13: Use of eval (eval-used)
</string>
<string>
W:2
699
, 13: Use of eval (eval-used)
</string>
<string>
W:2
757
, 13: Use of eval (eval-used)
</string>
<string>
W:2
784
, 13: Use of eval (eval-used)
</string>
<string>
W:
2941
, 13: Use of eval (eval-used)
</string>
<string>
W:
2969
, 13: Use of eval (eval-used)
</string>
<string>
W:3
018
, 13: Use of eval (eval-used)
</string>
<string>
W:3
065
, 13: Use of eval (eval-used)
</string>
<string>
W:5
45
, 13: Use of eval (eval-used)
</string>
<string>
W:
60
2, 13: Use of eval (eval-used)
</string>
<string>
W:8
51
, 13: Use of eval (eval-used)
</string>
<string>
W:14
80
, 13: Use of eval (eval-used)
</string>
<string>
W:16
8
9, 13: Use of eval (eval-used)
</string>
<string>
W:17
49
, 13: Use of eval (eval-used)
</string>
<string>
W:17
89
, 13: Use of eval (eval-used)
</string>
<string>
W:23
9
6, 13: Use of eval (eval-used)
</string>
<string>
W:2
803
, 13: Use of eval (eval-used)
</string>
<string>
W:2
863
, 13: Use of eval (eval-used)
</string>
<string>
W:2
890
, 13: Use of eval (eval-used)
</string>
<string>
W:
3047
, 13: Use of eval (eval-used)
</string>
<string>
W:
3075
, 13: Use of eval (eval-used)
</string>
<string>
W:3
124
, 13: Use of eval (eval-used)
</string>
<string>
W:3
171
, 13: Use of eval (eval-used)
</string>
</tuple>
</value>
</item>
...
...
@@ -117,25 +117,28 @@
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
<none/>
</tuple>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapToolComputerUpdateFromDict.xml
View file @
e09ba906
...
...
@@ -100,24 +100,28 @@
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
<pickle>
<tuple>
<none/>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</tuple>
<dictionary>
<item>
<key>
<string>
_log
</string>
</key>
<value>
<list>
<dictionary>
<item>
<key>
<string>
action
</string>
</key>
<value>
<string>
validate
</string>
</value>
</item>
<item>
<key>
<string>
validation_state
</string>
</key>
<value>
<string>
validated
</string>
</value>
</item>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
master/product/Vifib/Tool/SlapTool.py
View file @
e09ba906
...
...
@@ -1288,6 +1288,9 @@ class SlapTool(BaseTool):
software_instance_document
=
self
.
\
_getSoftwareInstanceForComputerPartition
(
computer_id
,
computer_partition_id
)
hosting_subscription
=
software_instance_document
.
getSpecialiseValue
()
if
hosting_subscription
is
not
None
and
hosting_subscription
.
getSlapState
()
==
"stop_requested"
:
state
=
'stopped'
kw
=
dict
(
software_release
=
software_release
,
software_type
=
software_type
,
software_title
=
partition_reference
,
...
...
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