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
Klaus Wölfel
slapos.core
Commits
65f8d096
Commit
65f8d096
authored
Jul 26, 2011
by
Rafael Monnerat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert Shared to Slave, but preserve Backward Compatibility of API.
parent
7c121912
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
master/product/Vifib/Tool/SlapTool.py
master/product/Vifib/Tool/SlapTool.py
+13
-7
No files found.
master/product/Vifib/Tool/SlapTool.py
View file @
65f8d096
...
...
@@ -92,6 +92,8 @@ def convertToREST(function):
wrapper
.
__doc__
=
function
.
__doc__
return
wrapper
_MARKER
=
[]
class
SlapTool
(
BaseTool
):
"""SlapTool"""
...
...
@@ -259,8 +261,8 @@ class SlapTool(BaseTool):
'requestComputerPartition'
)
def
requestComputerPartition
(
self
,
computer_id
=
None
,
computer_partition_id
=
None
,
software_release
=
None
,
software_type
=
None
,
partition_reference
=
None
,
s
hared
_xml
=
None
,
partition_parameter_xml
=
None
,
filter_xml
=
None
,
state
=
None
):
partition_reference
=
None
,
s
lave
_xml
=
None
,
partition_parameter_xml
=
None
,
filter_xml
=
None
,
state
=
None
,
shared_xml
=
_MARKER
):
"""
Asynchronously requests creation of computer partition for assigned
parameters
...
...
@@ -272,9 +274,13 @@ class SlapTool(BaseTool):
In any other case returns not important data and HTTP code is 403 Forbidden
"""
# Backward compatibility API, translate shared_xml into slave_xml.
# This should be removed as soon slap API be updated.
if
shared_xml
is
not
_MARKER
:
slave_xml
=
shared_xml
return
self
.
_requestComputerPartition
(
computer_id
,
computer_partition_id
,
software_release
,
software_type
,
partition_reference
,
s
hared
_xml
,
partition_parameter_xml
,
filter_xml
,
state
)
s
lave
_xml
,
partition_parameter_xml
,
filter_xml
,
state
)
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'useComputer'
)
...
...
@@ -552,7 +558,7 @@ class SlapTool(BaseTool):
@
convertToREST
def
_requestComputerPartition
(
self
,
computer_id
,
computer_partition_id
,
software_release
,
software_type
,
partition_reference
,
s
hared
_xml
,
partition_parameter_xml
,
filter_xml
,
state
):
s
lave
_xml
,
partition_parameter_xml
,
filter_xml
,
state
):
"""
Asynchronously requests creation of computer partition for assigned
parameters
...
...
@@ -569,10 +575,10 @@ class SlapTool(BaseTool):
state
=
xml_marshaller
.
xml_marshaller
.
loads
(
state
)
if
state
is
None
:
state
=
'started'
if
s
hared
_xml
:
s
hared
=
xml_marshaller
.
xml_marshaller
.
loads
(
shared
_xml
)
if
s
lave
_xml
:
s
lave
=
xml_marshaller
.
xml_marshaller
.
loads
(
slave
_xml
)
else
:
s
hared
=
False
s
lave
=
False
if
partition_parameter_xml
:
partition_parameter_kw
=
xml_marshaller
.
xml_marshaller
.
loads
(
partition_parameter_xml
)
...
...
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