Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos-mynij-dev
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
Mynij
slapos-mynij-dev
Commits
e15ca40d
Commit
e15ca40d
authored
Jul 12, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
request: Prepare support for plain python list options.
parent
5cf88baf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
+9
-3
slapos/recipe/request.py
slapos/recipe/request.py
+9
-3
No files found.
slapos/recipe/request.py
View file @
e15ca40d
...
...
@@ -33,6 +33,12 @@ import traceback
DEFAULT_SOFTWARE_TYPE
=
'RootSoftwareInstance'
def
getListOption
(
option_dict
,
key
,
default
=
()):
result
=
option_dict
.
get
(
key
,
default
)
if
isinstance
(
result
,
basestring
):
result
=
result
.
split
()
return
result
class
Recipe
(
object
):
"""
Request a partition to a slap master.
...
...
@@ -91,18 +97,18 @@ class Recipe(object):
self
.
logger
=
logging
.
getLogger
(
name
)
software_url
=
options
[
'software-url'
]
name
=
options
[
'name'
]
return_parameters
=
options
.
get
(
'return'
,
''
).
split
(
)
return_parameters
=
getListOption
(
options
,
'return'
)
if
not
return_parameters
:
self
.
logger
.
debug
(
"No parameter to return to main instance."
"Be careful about that..."
)
software_type
=
options
.
get
(
'software-type'
,
DEFAULT_SOFTWARE_TYPE
)
filter_kw
=
dict
(
(
x
,
options
[
'sla-'
+
x
])
for
x
in
options
.
get
(
'sla'
,
''
).
split
(
)
(
x
,
options
[
'sla-'
+
x
])
for
x
in
getListOption
(
options
,
'sla'
)
if
options
[
'sla-'
+
x
]
)
partition_parameter_kw
=
self
.
_filterForStorage
(
dict
(
(
x
,
options
[
'config-'
+
x
])
for
x
in
options
.
get
(
'config'
,
''
).
split
(
)
for
x
in
getListOption
(
options
,
'config'
)
))
slave
=
options
.
get
(
'slave'
,
'false'
).
lower
()
in
\
librecipe
.
GenericBaseRecipe
.
TRUE_VALUES
...
...
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