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
Thomas Gambier
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):
...
@@ -92,6 +92,8 @@ def convertToREST(function):
wrapper
.
__doc__
=
function
.
__doc__
wrapper
.
__doc__
=
function
.
__doc__
return
wrapper
return
wrapper
_MARKER
=
[]
class
SlapTool
(
BaseTool
):
class
SlapTool
(
BaseTool
):
"""SlapTool"""
"""SlapTool"""
...
@@ -259,8 +261,8 @@ class SlapTool(BaseTool):
...
@@ -259,8 +261,8 @@ class SlapTool(BaseTool):
'requestComputerPartition'
)
'requestComputerPartition'
)
def
requestComputerPartition
(
self
,
computer_id
=
None
,
def
requestComputerPartition
(
self
,
computer_id
=
None
,
computer_partition_id
=
None
,
software_release
=
None
,
software_type
=
None
,
computer_partition_id
=
None
,
software_release
=
None
,
software_type
=
None
,
partition_reference
=
None
,
s
hared
_xml
=
None
,
partition_parameter_xml
=
None
,
partition_reference
=
None
,
s
lave
_xml
=
None
,
partition_parameter_xml
=
None
,
filter_xml
=
None
,
state
=
None
):
filter_xml
=
None
,
state
=
None
,
shared_xml
=
_MARKER
):
"""
"""
Asynchronously requests creation of computer partition for assigned
Asynchronously requests creation of computer partition for assigned
parameters
parameters
...
@@ -272,9 +274,13 @@ class SlapTool(BaseTool):
...
@@ -272,9 +274,13 @@ class SlapTool(BaseTool):
In any other case returns not important data and HTTP code is 403 Forbidden
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
,
return
self
.
_requestComputerPartition
(
computer_id
,
computer_partition_id
,
software_release
,
software_type
,
partition_reference
,
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
,
security
.
declareProtected
(
Permissions
.
AccessContentsInformation
,
'useComputer'
)
'useComputer'
)
...
@@ -552,7 +558,7 @@ class SlapTool(BaseTool):
...
@@ -552,7 +558,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
,
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
Asynchronously requests creation of computer partition for assigned
parameters
parameters
...
@@ -569,10 +575,10 @@ class SlapTool(BaseTool):
...
@@ -569,10 +575,10 @@ class SlapTool(BaseTool):
state
=
xml_marshaller
.
xml_marshaller
.
loads
(
state
)
state
=
xml_marshaller
.
xml_marshaller
.
loads
(
state
)
if
state
is
None
:
if
state
is
None
:
state
=
'started'
state
=
'started'
if
s
hared
_xml
:
if
s
lave
_xml
:
s
hared
=
xml_marshaller
.
xml_marshaller
.
loads
(
shared
_xml
)
s
lave
=
xml_marshaller
.
xml_marshaller
.
loads
(
slave
_xml
)
else
:
else
:
s
hared
=
False
s
lave
=
False
if
partition_parameter_xml
:
if
partition_parameter_xml
:
partition_parameter_kw
=
xml_marshaller
.
xml_marshaller
.
loads
(
partition_parameter_kw
=
xml_marshaller
.
xml_marshaller
.
loads
(
partition_parameter_xml
)
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