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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.core
Commits
725c3231
Commit
725c3231
authored
Jul 03, 2020
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Plain Diff
SlapTool: all instances of a stopped HS are stopped
See merge request
nexedi/slapos.core!222
parents
e0817d60
e09ba906
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 @
725c3231
...
@@ -100,25 +100,28 @@
...
@@ -100,25 +100,28 @@
</record>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<tuple>
<dictionary>
<none/>
<item>
<list>
<key>
<string>
_log
</string>
</key>
<dictionary>
<value>
<item>
<list>
<key>
<string>
action
</string>
</key>
<dictionary>
<value>
<string>
validate
</string>
</value>
<item>
</item>
<key>
<string>
action
</string>
</key>
<item>
<value>
<string>
validate
</string>
</value>
<key>
<string>
validation_state
</string>
</key>
</item>
<value>
<string>
validated
</string>
</value>
<item>
</item>
<key>
<string>
validation_state
</string>
</key>
</dictionary>
<value>
<string>
validated
</string>
</value>
</list>
</item>
<none/>
</dictionary>
</tuple>
</list>
</value>
</item>
</dictionary>
</pickle>
</pickle>
</record>
</record>
</ZopeData>
</ZopeData>
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.py
View file @
725c3231
...
@@ -1862,6 +1862,41 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
...
@@ -1862,6 +1862,41 @@ class TestSlapOSSlapToolInstanceAccess(TestSlapOSSlapToolMixin):
if
os
.
path
.
exists
(
self
.
instance_request_simulator
):
if
os
.
path
.
exists
(
self
.
instance_request_simulator
):
os
.
unlink
(
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
):
def
test_updateInstancePredecessorList
(
self
):
self
.
_makeComplexComputer
()
self
.
_makeComplexComputer
()
...
...
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapTool.xml
View file @
725c3231
...
@@ -47,21 +47,21 @@
...
@@ -47,21 +47,21 @@
<value>
<value>
<tuple>
<tuple>
<string>
W: 28, 10: Use of eval (eval-used)
</string>
<string>
W: 28, 10: Use of eval (eval-used)
</string>
<string>
W:5
37
, 13: Use of eval (eval-used)
</string>
<string>
W:5
45
, 13: Use of eval (eval-used)
</string>
<string>
W:
59
2, 13: Use of eval (eval-used)
</string>
<string>
W:
60
2, 13: Use of eval (eval-used)
</string>
<string>
W:8
29
, 13: Use of eval (eval-used)
</string>
<string>
W:8
51
, 13: Use of eval (eval-used)
</string>
<string>
W:14
46
, 13: Use of eval (eval-used)
</string>
<string>
W:14
80
, 13: Use of eval (eval-used)
</string>
<string>
W:16
4
9, 13: Use of eval (eval-used)
</string>
<string>
W:16
8
9, 13: Use of eval (eval-used)
</string>
<string>
W:17
07
, 13: Use of eval (eval-used)
</string>
<string>
W:17
49
, 13: Use of eval (eval-used)
</string>
<string>
W:17
47
, 13: Use of eval (eval-used)
</string>
<string>
W:17
89
, 13: Use of eval (eval-used)
</string>
<string>
W:23
0
6, 13: Use of eval (eval-used)
</string>
<string>
W:23
9
6, 13: Use of eval (eval-used)
</string>
<string>
W:2
699
, 13: Use of eval (eval-used)
</string>
<string>
W:2
803
, 13: Use of eval (eval-used)
</string>
<string>
W:2
757
, 13: Use of eval (eval-used)
</string>
<string>
W:2
863
, 13: Use of eval (eval-used)
</string>
<string>
W:2
784
, 13: Use of eval (eval-used)
</string>
<string>
W:2
890
, 13: Use of eval (eval-used)
</string>
<string>
W:
2941
, 13: Use of eval (eval-used)
</string>
<string>
W:
3047
, 13: Use of eval (eval-used)
</string>
<string>
W:
2969
, 13: Use of eval (eval-used)
</string>
<string>
W:
3075
, 13: Use of eval (eval-used)
</string>
<string>
W:3
018
, 13: Use of eval (eval-used)
</string>
<string>
W:3
124
, 13: Use of eval (eval-used)
</string>
<string>
W:3
065
, 13: Use of eval (eval-used)
</string>
<string>
W:3
171
, 13: Use of eval (eval-used)
</string>
</tuple>
</tuple>
</value>
</value>
</item>
</item>
...
@@ -117,25 +117,28 @@
...
@@ -117,25 +117,28 @@
</record>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<tuple>
<dictionary>
<none/>
<item>
<list>
<key>
<string>
_log
</string>
</key>
<dictionary>
<value>
<item>
<list>
<key>
<string>
action
</string>
</key>
<dictionary>
<value>
<string>
validate
</string>
</value>
<item>
</item>
<key>
<string>
action
</string>
</key>
<item>
<value>
<string>
validate
</string>
</value>
<key>
<string>
validation_state
</string>
</key>
</item>
<value>
<string>
validated
</string>
</value>
<item>
</item>
<key>
<string>
validation_state
</string>
</key>
</dictionary>
<value>
<string>
validated
</string>
</value>
</list>
</item>
<none/>
</dictionary>
</tuple>
</list>
</value>
</item>
</dictionary>
</pickle>
</pickle>
</record>
</record>
</ZopeData>
</ZopeData>
master/bt5/slapos_slap_tool/TestTemplateItem/portal_components/test.erp5.testSlapOSSlapToolComputerUpdateFromDict.xml
View file @
725c3231
...
@@ -100,24 +100,28 @@
...
@@ -100,24 +100,28 @@
</record>
</record>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<record
id=
"4"
aka=
"AAAAAAAAAAQ="
>
<pickle>
<pickle>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
patches.WorkflowTool
"
/>
<global
name=
"WorkflowHistoryList"
module=
"Products.ERP5Type.
Workflow
"
/>
</pickle>
</pickle>
<pickle>
<pickle>
<tuple>
<dictionary>
<none/>
<item>
<list>
<key>
<string>
_log
</string>
</key>
<dictionary>
<value>
<item>
<list>
<key>
<string>
action
</string>
</key>
<dictionary>
<value>
<string>
validate
</string>
</value>
<item>
</item>
<key>
<string>
action
</string>
</key>
<item>
<value>
<string>
validate
</string>
</value>
<key>
<string>
validation_state
</string>
</key>
</item>
<value>
<string>
validated
</string>
</value>
<item>
</item>
<key>
<string>
validation_state
</string>
</key>
</dictionary>
<value>
<string>
validated
</string>
</value>
</list>
</item>
</tuple>
</dictionary>
</list>
</value>
</item>
</dictionary>
</pickle>
</pickle>
</record>
</record>
</ZopeData>
</ZopeData>
master/product/Vifib/Tool/SlapTool.py
View file @
725c3231
...
@@ -1288,6 +1288,9 @@ class SlapTool(BaseTool):
...
@@ -1288,6 +1288,9 @@ class SlapTool(BaseTool):
software_instance_document
=
self
.
\
software_instance_document
=
self
.
\
_getSoftwareInstanceForComputerPartition
(
computer_id
,
_getSoftwareInstanceForComputerPartition
(
computer_id
,
computer_partition_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
,
kw
=
dict
(
software_release
=
software_release
,
software_type
=
software_type
,
software_type
=
software_type
,
software_title
=
partition_reference
,
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