Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
isaak yansane-sisk
slapos
Commits
23136175
Commit
23136175
authored
Feb 19, 2013
by
Cédric de Saint Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
softwaretype recipe: all falsy parameter values are ignored.
parent
b5f22b33
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
4 deletions
+8
-4
slapos/recipe/softwaretype.py
slapos/recipe/softwaretype.py
+8
-4
No files found.
slapos/recipe/softwaretype.py
View file @
23136175
...
@@ -114,10 +114,14 @@ class Recipe:
...
@@ -114,10 +114,14 @@ class Recipe:
if
not
buildout
.
has_section
(
'slap-parameter'
):
if
not
buildout
.
has_section
(
'slap-parameter'
):
buildout
.
add_section
(
'slap-parameter'
)
buildout
.
add_section
(
'slap-parameter'
)
for
parameter
,
value
in
self
.
parameter_dict
.
items
():
for
parameter
,
value
in
self
.
parameter_dict
.
items
():
if
isinstance
(
value
,
str
):
# All parameters evaluating to False are... False, and shouldn't
buildout
.
set
(
'slap-parameter'
,
parameter
,
value
)
# convey any information.
else
:
# Here, all those parameters are set to empty string.
buildout
.
set
(
'slap-parameter'
,
parameter
,
json
.
dumps
(
value
))
if
value
:
if
isinstance
(
value
,
str
):
buildout
.
set
(
'slap-parameter'
,
parameter
,
value
)
else
:
buildout
.
set
(
'slap-parameter'
,
parameter
,
json
.
dumps
(
value
))
buildout
.
add_section
(
'slap-network-information'
)
buildout
.
add_section
(
'slap-network-information'
)
buildout
.
set
(
'slap-network-information'
,
'local-ipv4'
,
buildout
.
set
(
'slap-network-information'
,
'local-ipv4'
,
...
...
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