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
Roque
slapos.core
Commits
90fb9773
Commit
90fb9773
authored
Oct 11, 2011
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to change the software type of a instance.
This fix ComputerPartition.request software type modification
parent
3ca1ad85
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
4 deletions
+79
-4
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/scripts/SoftwareInstance_requestSoftwareInstance.xml
...flow/scripts/SoftwareInstance_requestSoftwareInstance.xml
+2
-2
master/bt5/vifib_base/bt/revision
master/bt5/vifib_base/bt/revision
+1
-1
master/product/Vifib/tests/testVifibSlapComputerPartitionRequest.py
...duct/Vifib/tests/testVifibSlapComputerPartitionRequest.py
+73
-0
master/product/Vifib/tests/testVifibSlapOpenOrderRequest.py
master/product/Vifib/tests/testVifibSlapOpenOrderRequest.py
+1
-0
master/product/Vifib/tests/testVifibSlapWebService.py
master/product/Vifib/tests/testVifibSlapWebService.py
+2
-1
No files found.
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/scripts/SoftwareInstance_requestSoftwareInstance.xml
View file @
90fb9773
...
...
@@ -85,7 +85,7 @@ while (predecessor_software_instance is not None):\n
predecessor_software_instance = predecessor_software_instance.getPredecessorRelatedValue(\n
portal_type="Software Instance")\n
\n
tag = "%s_%s_
%s_inProgress" % (root_software_instance.getUid(), software_type
,\n
tag = "%s_%s_
inProgress" % (root_software_instance.getUid()
,\n
requested_partition_reference)\n
\n
# Check if it already exists\n
...
...
@@ -94,7 +94,6 @@ request_software_instance = software_instance.portal_catalog.getResultValue(\n
# XXX: User based property is used in non manual operation\n
# XXX-2: Do we really need to use root_uid?\n
title=requested_partition_reference,\n
source_reference=software_type,\n
root_uid=root_software_instance.getUid(),\n
)\n
\n
...
...
@@ -134,6 +133,7 @@ else:\n
# Sale Packing List interaction has to be requested automatically with an interaction workflow\n
request_software_instance.edit(\n
text_content=instance_xml,\n
source_reference=software_type,\n
sla_xml=sla_xml,\n
activate_kw={\'tag\': tag},\n
)\n
...
...
master/bt5/vifib_base/bt/revision
View file @
90fb9773
30
1
30
2
master/product/Vifib/tests/testVifibSlapComputerPartitionRequest.py
View file @
90fb9773
...
...
@@ -6,6 +6,7 @@ import httplib
from
xml_marshaller
import
xml_marshaller
import
unittest
from
testVifibSlapWebService
import
TestVifibSlapWebServiceMixin
from
slapos
import
slap
class
TestVifibSlapComputerPartitionRequest
(
TestVifibSlapWebServiceMixin
):
########################################
...
...
@@ -1011,6 +1012,78 @@ class TestVifibSlapComputerPartitionRequest(TestVifibSlapWebServiceMixin):
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
##################################################
# ComputerPartition.request - change software type
##################################################
def
stepSetFirstSoftwareType
(
self
,
sequence
,
**
kw
):
sequence
.
edit
(
requested_software_type
=
"FirstSoftwareType"
)
def
stepRequestComputerPartitionWithAnotherSoftwareType
(
self
,
sequence
,
**
kw
):
self
.
slap
=
slap
.
slap
()
self
.
slap
.
initializeConnection
(
self
.
server_url
)
slap_computer_partition
=
self
.
slap
.
registerComputerPartition
(
sequence
[
'computer_reference'
],
sequence
[
'computer_partition_reference'
])
kw
=
dict
(
software_release
=
sequence
[
'software_release_uri'
],
software_type
=
"SecondSoftwareType"
,
partition_reference
=
sequence
.
get
(
'requested_reference'
,
'requested_reference'
),
partition_parameter_kw
=
sequence
.
get
(
'requested_parameter_dict'
,
{}),
filter_kw
=
sequence
.
get
(
'requested_filter_dict'
,
{}),
state
=
sequence
.
get
(
'instance_state'
))
requested_slap_computer_partition
=
slap_computer_partition
.
request
(
**
kw
)
def
stepCheckRequestComputerPartitionWithAnotherSoftwareType
(
self
,
sequence
,
**
kw
):
self
.
slap
=
slap
.
slap
()
self
.
slap
.
initializeConnection
(
self
.
server_url
)
slap_computer_partition
=
self
.
slap
.
registerComputerPartition
(
sequence
[
'computer_reference'
],
sequence
[
'computer_partition_reference'
])
kw
=
dict
(
software_release
=
sequence
[
'software_release_uri'
],
software_type
=
"SecondSoftwareType"
,
partition_reference
=
sequence
.
get
(
'requested_reference'
,
'requested_reference'
),
partition_parameter_kw
=
sequence
.
get
(
'requested_parameter_dict'
,
{}),
filter_kw
=
sequence
.
get
(
'requested_filter_dict'
,
{}),
state
=
sequence
.
get
(
'instance_state'
))
requested_slap_computer_partition
=
slap_computer_partition
.
request
(
**
kw
)
self
.
assertEquals
(
sequence
.
get
(
'requested_computer_partition_reference'
),
requested_slap_computer_partition
.
getId
())
self
.
assertEquals
(
"SecondSoftwareType"
,
requested_slap_computer_partition
.
getInstanceParameterDict
()[
'slap_software_type'
])
self
.
assertEquals
(
1
,
requested_slap_computer_partition
.
_need_modification
)
def
test_ComputerPartition_request_changeSoftwareType
(
self
):
"""
Check that requesting the same instance with a different software type
does not create a new instance
"""
self
.
computer_partition_amount
=
3
sequence_list
=
SequenceList
()
sequence_string
=
self
.
prepare_install_requested_computer_partition_sequence_string
+
'
\
SelectRequestedReference
\
SelectEmptyRequestedParameterDict
\
\
SlapLoginCurrentSoftwareInstance
\
SetFirstSoftwareType
\
RequestComputerPartition
\
Tic
\
RequestComputerPartitionWithAnotherSoftwareType
\
Tic
\
CheckRequestComputerPartitionWithAnotherSoftwareType
\
Tic
\
SlapLogout
\
'
sequence_list
.
addSequenceString
(
sequence_string
)
sequence_list
.
play
(
self
)
def
test_suite
():
suite
=
unittest
.
TestSuite
()
suite
.
addTest
(
unittest
.
makeSuite
(
TestVifibSlapComputerPartitionRequest
))
...
...
master/product/Vifib/tests/testVifibSlapOpenOrderRequest.py
View file @
90fb9773
...
...
@@ -260,6 +260,7 @@ class TestVifibSlapOpenOrderRequest(TestVifibSlapWebServiceMixin):
PersonRequestSlapSoftwareInstanceWithAnotherSoftwareType
Tic
CheckPersonRequestSlapSoftwareInstanceWithAnotherSoftwareType
Tic
SlapLogout
"""
sequence_list
.
addSequenceString
(
sequence_string
)
...
...
master/product/Vifib/tests/testVifibSlapWebService.py
View file @
90fb9773
...
...
@@ -1515,7 +1515,8 @@ class TestVifibSlapWebServiceMixin(testVifibMixin):
sequence
[
'computer_reference'
],
sequence
[
'computer_partition_reference'
])
kw
=
dict
(
software_release
=
sequence
[
'software_release_uri'
],
software_type
=
sequence
.
get
(
'requested_reference'
,
'requested_reference'
),
software_type
=
sequence
.
get
(
'requested_software_type'
,
'requested_software_type'
),
partition_reference
=
sequence
.
get
(
'requested_reference'
,
'requested_reference'
),
partition_parameter_kw
=
sequence
.
get
(
'requested_parameter_dict'
,
{}),
...
...
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