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
Eric Zheng
slapos.core
Commits
b493ca7c
Commit
b493ca7c
authored
Jul 02, 2012
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add default software type in libslap
parent
16765399
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
0 deletions
+9
-0
slapos/slap/slap.py
slapos/slap/slap.py
+9
-0
No files found.
slapos/slap/slap.py
View file @
b493ca7c
...
@@ -42,6 +42,8 @@ import zope.interface
...
@@ -42,6 +42,8 @@ import zope.interface
Simple, easy to (un)marshall classes for slap client/server communication
Simple, easy to (un)marshall classes for slap client/server communication
"""
"""
DEFAULT_SOFTWARE_TYPE
=
'default'
# httplib.HTTPSConnection with key verification
# httplib.HTTPSConnection with key verification
class
HTTPSConnectionCA
(
httplib
.
HTTPSConnection
):
class
HTTPSConnectionCA
(
httplib
.
HTTPSConnection
):
"""Patched version of HTTPSConnection which verifies server certificate"""
"""Patched version of HTTPSConnection which verifies server certificate"""
...
@@ -181,6 +183,9 @@ class OpenOrder(SlapDocument):
...
@@ -181,6 +183,9 @@ class OpenOrder(SlapDocument):
}
}
if
software_type
is
not
None
:
if
software_type
is
not
None
:
request_dict
[
'software_type'
]
=
software_type
request_dict
[
'software_type'
]
=
software_type
else
:
# Let's enforce a default software type
request_dict
[
'software_type'
]
=
DEFAULT_SOFTWARE_TYPE
try
:
try
:
self
.
_connection_helper
.
POST
(
'/requestComputerPartition'
,
request_dict
)
self
.
_connection_helper
.
POST
(
'/requestComputerPartition'
,
request_dict
)
except
ResourceNotReady
:
except
ResourceNotReady
:
...
@@ -359,6 +364,10 @@ class ComputerPartition(SlapDocument):
...
@@ -359,6 +364,10 @@ class ComputerPartition(SlapDocument):
raise
ValueError
(
"Unexpected type of filter_kw '%s'"
%
\
raise
ValueError
(
"Unexpected type of filter_kw '%s'"
%
\
filter_kw
)
filter_kw
)
# Let enforce a default software type
if
software_type
is
None
:
software_type
=
DEFAULT_SOFTWARE_TYPE
request_dict
=
{
'computer_id'
:
self
.
_computer_id
,
request_dict
=
{
'computer_id'
:
self
.
_computer_id
,
'computer_partition_id'
:
self
.
_partition_id
,
'computer_partition_id'
:
self
.
_partition_id
,
'software_release'
:
software_release
,
'software_release'
:
software_release
,
...
...
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