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
Xavier Thompson
slapos.core
Commits
8d00f922
Commit
8d00f922
authored
Oct 26, 2012
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify and reuse existing API.
parent
eb024263
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
86 additions
and
54 deletions
+86
-54
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSSlapTool.py
...r/bt5/slapos_cloud/TestTemplateItem/testSlapOSSlapTool.py
+85
-53
master/bt5/slapos_cloud/bt/revision
master/bt5/slapos_cloud/bt/revision
+1
-1
No files found.
master/bt5/slapos_cloud/TestTemplateItem/testSlapOSSlapTool.py
View file @
8d00f922
...
...
@@ -123,88 +123,120 @@ class TestSlapOSSlapToolMixin(testSlapOSMixin):
self
.
computer
.
partition2
.
markBusy
()
self
.
computer
.
partition3
.
markBusy
()
# prepare some trees
hosting_subscription
=
self
.
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
start_requested_software_instance
=
self
.
portal
.
software_instance_module
\
.
template_software_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
hosting_subscription
.
edit
(
predecessor
=
self
.
start_requested_software_instance
.
getRelativeUrl
()
)
hosting_subscription
.
validate
()
self
.
start_requested_software_instance
.
edit
(
hosting_subscription
.
edit
(
title
=
self
.
generateNewSoftwareTitle
(),
reference
=
"TESTSI-%s"
%
self
.
generateNewId
(),
url_string
=
\
)
kw
=
dict
(
software_release
=
\
self
.
start_requested_software_installation
.
getUrlString
(),
source_reference
=
self
.
generateNewSoftwareType
(),
text_content
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
aggregate
=
self
.
computer
.
partition1
.
getRelativeUrl
(),
specialise
=
hosting_subscription
.
getRelativeUrl
()
software_type
=
self
.
generateNewSoftwareType
(),
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
shared
=
False
,
software_title
=
hosting_subscription
.
getTitle
(),
state
=
'started'
)
hosting_subscription
.
requestStart
(
**
kw
)
hosting_subscription
.
requestInstance
(
**
kw
)
self
.
start_requested_software_instance
=
hosting_subscription
.
getPredecessorValue
()
self
.
start_requested_software_instance
.
edit
(
aggregate
=
self
.
computer
.
partition1
.
getRelativeUrl
())
hosting_subscription
=
self
.
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
hosting_subscription
.
edit
(
)
hosting_subscription
.
validate
()
hosting_subscription
.
edit
(
title
=
self
.
generateNewSoftwareTitle
(),
reference
=
"TESTSI-%s"
%
self
.
generateNewId
(),
url_string
=
\
)
kw
=
dict
(
software_release
=
\
self
.
start_requested_software_installation
.
getUrlString
(),
source_reference
=
self
.
generateNewSoftwareType
(),
text_content
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
aggregate
=
self
.
computer
.
partition1
.
getRelativeUrl
()
software_type
=
self
.
generateNewSoftwareType
(),
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
shared
=
False
,
software_title
=
hosting_subscription
.
getTitle
(),
state
=
'stopped'
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
hosting_subscription
,
'start_requested'
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
self
.
start_requested_software_instance
,
'start_requested'
)
self
.
start_requested_software_instance
.
validate
()
self
.
stop_requested_software_instance
=
self
.
portal
.
software_instance_module
\
.
template_software_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
hosting_subscription
.
requestStop
(
**
kw
)
hosting_subscription
.
requestInstance
(
**
kw
)
self
.
stop_requested_software_instance
=
hosting_subscription
.
getPredecessorValue
()
self
.
stop_requested_software_instance
.
edit
(
title
=
self
.
generateNewSoftwareTitle
(),
reference
=
"TESTSI-%s"
%
self
.
generateNewId
(),
url_string
=
\
self
.
start_requested_software_installation
.
getUrlString
(),
source_reference
=
self
.
generateNewSoftwareType
(),
text_content
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
aggregate
=
self
.
computer
.
partition2
.
getRelativeUrl
()
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
self
.
stop_requested_software_instance
,
'stop_requested'
)
self
.
stop_requested_software_instance
.
validate
()
self
.
destroy_requested_software_instance
=
self
.
portal
.
software_instance_module
\
.
template_software_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
destroy_requested_software_instance
.
edit
(
hosting_subscription
=
self
.
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
hosting_subscription
.
edit
(
)
hosting_subscription
.
validate
()
hosting_subscription
.
edit
(
title
=
self
.
generateNewSoftwareTitle
(),
reference
=
"TESTSI-%s"
%
self
.
generateNewId
(),
url_string
=
\
)
kw
=
dict
(
software_release
=
\
self
.
start_requested_software_installation
.
getUrlString
(),
source_reference
=
self
.
generateNewSoftwareType
(),
text_content
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
software_type
=
self
.
generateNewSoftwareType
(),
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
shared
=
False
,
software_title
=
hosting_subscription
.
getTitle
(),
state
=
'stopped'
)
hosting_subscription
.
requestStop
(
**
kw
)
hosting_subscription
.
requestInstance
(
**
kw
)
kw
[
'state'
]
=
'destroyed'
hosting_subscription
.
requestDestroy
(
**
kw
)
self
.
destroy_requested_software_instance
=
hosting_subscription
.
getPredecessorValue
()
self
.
destroy_requested_software_instance
.
requestDestroy
(
**
kw
)
self
.
destroy_requested_software_instance
.
edit
(
aggregate
=
self
.
computer
.
partition3
.
getRelativeUrl
()
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
self
.
destroy_requested_software_instance
,
'destroy_requested'
)
self
.
destroy_requested_software_instance
.
validate
()
self
.
destroyed_software_instance
=
self
.
portal
.
software_instance_module
\
.
template_software_instance
.
Base_createCloneDocument
(
batch_mode
=
1
)
self
.
destroyed_software_instance
.
edit
(
hosting_subscription
=
self
.
portal
.
hosting_subscription_module
\
.
template_hosting_subscription
.
Base_createCloneDocument
(
batch_mode
=
1
)
hosting_subscription
.
edit
(
)
hosting_subscription
.
validate
()
hosting_subscription
.
edit
(
title
=
self
.
generateNewSoftwareTitle
(),
reference
=
"TESTSI-%s"
%
self
.
generateNewId
(),
url_string
=
\
)
kw
=
dict
(
software_release
=
\
self
.
start_requested_software_installation
.
getUrlString
(),
source_reference
=
self
.
generateNewSoftwareType
(),
text_content
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
software_type
=
self
.
generateNewSoftwareType
(),
instance_xml
=
self
.
generateSafeXml
(),
sla_xml
=
self
.
generateSafeXml
(),
shared
=
False
,
software_title
=
hosting_subscription
.
getTitle
(),
state
=
'stopped'
)
hosting_subscription
.
requestStop
(
**
kw
)
hosting_subscription
.
requestInstance
(
**
kw
)
kw
[
'state'
]
=
'destroyed'
hosting_subscription
.
requestDestroy
(
**
kw
)
self
.
destroyed_software_instance
=
hosting_subscription
.
getPredecessorValue
()
self
.
destroyed_software_instance
.
edit
(
aggregate
=
self
.
computer
.
partition4
.
getRelativeUrl
()
)
self
.
portal
.
portal_workflow
.
_jumpToStateFor
(
self
.
destroyed_software_instance
,
'destroy_requested'
)
self
.
destroyed_software_instance
.
validate
()
self
.
destroyed_software_instance
.
requestDestroy
(
**
kw
)
self
.
destroyed_software_instance
.
invalidate
()
self
.
tic
()
...
...
master/bt5/slapos_cloud/bt/revision
View file @
8d00f922
128
\ No newline at end of file
129
\ No newline at end of file
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