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
Jérome Perrin
slapos.core
Commits
41740ae2
Commit
41740ae2
authored
Jun 01, 2011
by
Łukasz Nowak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Use filter instead of new sla_parameter to have backward compatibility.
parent
0febf457
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
24 deletions
+13
-24
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/scripts/SoftwareInstance_requestComputerPartition.xml
...low/scripts/SoftwareInstance_requestComputerPartition.xml
+3
-3
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/scripts/SoftwareInstance_requestSoftwareInstance.xml
...flow/scripts/SoftwareInstance_requestSoftwareInstance.xml
+1
-2
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+4
-10
slapos/slap/slap.py
slapos/slap/slap.py
+5
-9
No files found.
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/scripts/SoftwareInstance_requestComputerPartition.xml
View file @
41740ae2
...
@@ -61,7 +61,7 @@ hosting_subscription_uid = state_change.kwargs[\'hosting_subscription_uid\']\n
...
@@ -61,7 +61,7 @@ hosting_subscription_uid = state_change.kwargs[\'hosting_subscription_uid\']\n
shared = state_change.kwargs[\'shared\']\n
shared = state_change.kwargs[\'shared\']\n
software_type = state_change.kwargs["software_type"]\n
software_type = state_change.kwargs["software_type"]\n
tag = state_change.kwargs[\'tag\']\n
tag = state_change.kwargs[\'tag\']\n
sla_parameter_kw = kwargs["sla_parame
ter_kw"]\n
filter_kw = kwargs["fil
ter_kw"]\n
\n
\n
# Assertion: No packing list line should be related to this software instance\n
# Assertion: No packing list line should be related to this software instance\n
packing_list_line = software_instance.getAggregateRelatedValue(portal_type=\'Sale Packing List Line\')\n
packing_list_line = software_instance.getAggregateRelatedValue(portal_type=\'Sale Packing List Line\')\n
...
@@ -79,8 +79,8 @@ query_kw = {\n
...
@@ -79,8 +79,8 @@ query_kw = {\n
\'portal_type\': \'Computer Partition\'\n
\'portal_type\': \'Computer Partition\'\n
}\n
}\n
# support SLA\n
# support SLA\n
if "computer_guid" in
sla_parame
ter_kw:\n
if "computer_guid" in
fil
ter_kw:\n
query_kw["parent_reference"] =
sla_parame
ter_kw["computer_guid"]\n
query_kw["parent_reference"] =
fil
ter_kw["computer_guid"]\n
\n
\n
# fetch at mot 50 random Computer Partitions, and check if they are ok\n
# fetch at mot 50 random Computer Partitions, and check if they are ok\n
isTransitionPossible = software_instance.getPortalObject().portal_workflow.isTransitionPossible\n
isTransitionPossible = software_instance.getPortalObject().portal_workflow.isTransitionPossible\n
...
...
master/bt5/vifib_base/WorkflowTemplateItem/portal_workflow/software_instance_slap_interface_workflow/scripts/SoftwareInstance_requestSoftwareInstance.xml
View file @
41740ae2
...
@@ -62,7 +62,6 @@ shared = kwargs["shared"]\n
...
@@ -62,7 +62,6 @@ shared = kwargs["shared"]\n
software_type = kwargs["software_type"]\n
software_type = kwargs["software_type"]\n
instance_xml = kwargs["instance_xml"]\n
instance_xml = kwargs["instance_xml"]\n
filter_kw = kwargs["filter_kw"]\n
filter_kw = kwargs["filter_kw"]\n
sla_parameter_kw = kwargs["sla_parameter_kw"]\n
\n
\n
# Get root software instance\n
# Get root software instance\n
predecessor_software_instance = software_instance\n
predecessor_software_instance = software_instance\n
...
@@ -110,7 +109,7 @@ if (request_software_instance is None):\n
...
@@ -110,7 +109,7 @@ if (request_software_instance is None):\n
shared=shared,\n
shared=shared,\n
software_type=software_type,\n
software_type=software_type,\n
tag=tag,\n
tag=tag,\n
sla_parameter_kw=sla_parame
ter_kw)\n
filter_kw=fil
ter_kw)\n
else:\n
else:\n
# Update existing software instance\n
# Update existing software instance\n
# Sale Packing List interaction has to be requested automatically with an interaction workflow\n
# Sale Packing List interaction has to be requested automatically with an interaction workflow\n
...
...
master/product/Vifib/Tool/SlapTool.py
View file @
41740ae2
...
@@ -244,7 +244,7 @@ class SlapTool(BaseTool):
...
@@ -244,7 +244,7 @@ class SlapTool(BaseTool):
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'requestComputerPartition'
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'requestComputerPartition'
)
def
requestComputerPartition
(
self
,
computer_id
,
computer_partition_id
,
def
requestComputerPartition
(
self
,
computer_id
,
computer_partition_id
,
software_release
,
software_type
,
partition_reference
,
software_release
,
software_type
,
partition_reference
,
shared_xml
,
partition_parameter_xml
,
filter_xml
,
sla_parameter_xml
):
shared_xml
,
partition_parameter_xml
,
filter_xml
):
"""
"""
Asynchronously requests creation of computer partition for assigned
Asynchronously requests creation of computer partition for assigned
parameters
parameters
...
@@ -258,7 +258,7 @@ class SlapTool(BaseTool):
...
@@ -258,7 +258,7 @@ class SlapTool(BaseTool):
"""
"""
return
self
.
_requestComputerPartition
(
computer_id
,
computer_partition_id
,
return
self
.
_requestComputerPartition
(
computer_id
,
computer_partition_id
,
software_release
,
software_type
,
partition_reference
,
software_release
,
software_type
,
partition_reference
,
shared_xml
,
partition_parameter_xml
,
filter_xml
,
sla_parameter_xml
)
shared_xml
,
partition_parameter_xml
,
filter_xml
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'useComputer'
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'useComputer'
)
def
useComputer
(
self
,
computer_id
,
use_string
):
def
useComputer
(
self
,
computer_id
,
use_string
):
...
@@ -544,7 +544,7 @@ class SlapTool(BaseTool):
...
@@ -544,7 +544,7 @@ class SlapTool(BaseTool):
@
convertToREST
@
convertToREST
def
_requestComputerPartition
(
self
,
computer_id
,
computer_partition_id
,
def
_requestComputerPartition
(
self
,
computer_id
,
computer_partition_id
,
software_release
,
software_type
,
partition_reference
,
software_release
,
software_type
,
partition_reference
,
shared_xml
,
partition_parameter_xml
,
filter_xml
,
sla_parameter_xml
):
shared_xml
,
partition_parameter_xml
,
filter_xml
):
"""
"""
Asynchronously requests creation of computer partition for assigned
Asynchronously requests creation of computer partition for assigned
parameters
parameters
...
@@ -565,11 +565,6 @@ class SlapTool(BaseTool):
...
@@ -565,11 +565,6 @@ class SlapTool(BaseTool):
partition_parameter_xml
)
partition_parameter_xml
)
else
:
else
:
partition_parameter_kw
=
dict
()
partition_parameter_kw
=
dict
()
if
sla_parameter_xml
:
sla_parameter_kw
=
xml_marshaller
.
xml_marshaller
.
loads
(
sla_parameter_xml
)
else
:
sla_parameter_kw
=
dict
()
if
filter_xml
:
if
filter_xml
:
filter_kw
=
xml_marshaller
.
xml_marshaller
.
loads
(
filter_xml
)
filter_kw
=
xml_marshaller
.
xml_marshaller
.
loads
(
filter_xml
)
else
:
else
:
...
@@ -593,8 +588,7 @@ class SlapTool(BaseTool):
...
@@ -593,8 +588,7 @@ class SlapTool(BaseTool):
partition_reference
=
partition_reference
,
partition_reference
=
partition_reference
,
shared
=
shared
,
shared
=
shared
,
instance_xml
=
instance_xml
,
instance_xml
=
instance_xml
,
filter_kw
=
filter_kw
,
filter_kw
=
filter_kw
)
sla_parameter_kw
=
sla_parameter_kw
)
# Get requested software instance
# Get requested software instance
requested_software_instance
=
software_instance_document
.
portal_catalog
.
\
requested_software_instance
=
software_instance_document
.
portal_catalog
.
\
...
...
slapos/slap/slap.py
View file @
41740ae2
...
@@ -149,16 +149,16 @@ class OpenOrder(SlapDocument):
...
@@ -149,16 +149,16 @@ class OpenOrder(SlapDocument):
zope
.
interface
.
implements
(
interface
.
IOpenOrder
)
zope
.
interface
.
implements
(
interface
.
IOpenOrder
)
def
request
(
self
,
software_release
,
partition_reference
,
def
request
(
self
,
software_release
,
partition_reference
,
partition_parameter_kw
=
None
,
software_type
=
None
,
sla_parame
ter_kw
=
None
):
partition_parameter_kw
=
None
,
software_type
=
None
,
fil
ter_kw
=
None
):
if
partition_parameter_kw
is
None
:
if
partition_parameter_kw
is
None
:
partition_parameter_kw
=
{}
partition_parameter_kw
=
{}
if
sla_parame
ter_kw
is
None
:
if
fil
ter_kw
is
None
:
sla_parame
ter_kw
=
{}
fil
ter_kw
=
{}
request_dict
=
{
request_dict
=
{
'software_release'
:
software_release
,
'software_release'
:
software_release
,
'partition_reference'
:
partition_reference
,
'partition_reference'
:
partition_reference
,
'partition_parameter_xml'
:
xml_marshaller
.
dumps
(
partition_parameter_kw
),
'partition_parameter_xml'
:
xml_marshaller
.
dumps
(
partition_parameter_kw
),
'
sla_parameter_xml'
:
xml_marshaller
.
dumps
(
sla_parame
ter_kw
)
'
filter_xml'
:
xml_marshaller
.
dumps
(
fil
ter_kw
)
}
}
if
software_type
is
not
None
:
if
software_type
is
not
None
:
request_dict
[
'software_type'
]
=
software_type
request_dict
[
'software_type'
]
=
software_type
...
@@ -282,12 +282,9 @@ class ComputerPartition(SlapDocument):
...
@@ -282,12 +282,9 @@ class ComputerPartition(SlapDocument):
# Computer Partition data are fetch from server shall be delayed
# Computer Partition data are fetch from server shall be delayed
@
_syncComputerPartitionInformation
@
_syncComputerPartitionInformation
def
request
(
self
,
software_release
,
software_type
,
partition_reference
,
def
request
(
self
,
software_release
,
software_type
,
partition_reference
,
shared
=
False
,
partition_parameter_kw
=
None
,
filter_kw
=
None
,
shared
=
False
,
partition_parameter_kw
=
None
,
filter_kw
=
None
):
sla_parameter_kw
=
None
):
if
partition_parameter_kw
is
None
:
if
partition_parameter_kw
is
None
:
partition_parameter_kw
=
{}
partition_parameter_kw
=
{}
if
sla_parameter_kw
is
None
:
sla_parameter_kw
=
{}
elif
not
isinstance
(
partition_parameter_kw
,
dict
):
elif
not
isinstance
(
partition_parameter_kw
,
dict
):
raise
ValueError
(
"Unexpected type of partition_parameter_kw '%s'"
%
\
raise
ValueError
(
"Unexpected type of partition_parameter_kw '%s'"
%
\
partition_parameter_kw
)
partition_parameter_kw
)
...
@@ -307,7 +304,6 @@ class ComputerPartition(SlapDocument):
...
@@ -307,7 +304,6 @@ class ComputerPartition(SlapDocument):
'partition_parameter_xml'
:
xml_marshaller
.
dumps
(
'partition_parameter_xml'
:
xml_marshaller
.
dumps
(
partition_parameter_kw
),
partition_parameter_kw
),
'filter_xml'
:
xml_marshaller
.
dumps
(
filter_kw
),
'filter_xml'
:
xml_marshaller
.
dumps
(
filter_kw
),
'sla_parameter_xml'
:
xml_marshaller
.
dumps
(
sla_parameter_kw
)
}
}
self
.
_connection_helper
.
POST
(
'/requestComputerPartition'
,
request_dict
)
self
.
_connection_helper
.
POST
(
'/requestComputerPartition'
,
request_dict
)
xml
=
self
.
_connection_helper
.
response
.
read
()
xml
=
self
.
_connection_helper
.
response
.
read
()
...
...
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