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
Jean-Paul Smets
slapos
Commits
e789c59f
Commit
e789c59f
authored
Jul 11, 2013
by
Vincent Pelletier
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Make all erp5_promise recipe options optional.
Also, reduce code duplication.
parent
1cdca39e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
13 deletions
+17
-13
slapos/recipe/erp5_promise/__init__.py
slapos/recipe/erp5_promise/__init__.py
+17
-13
No files found.
slapos/recipe/erp5_promise/__init__.py
View file @
e789c59f
...
...
@@ -34,19 +34,23 @@ class Recipe(GenericBaseRecipe):
"""
def
install
(
self
):
promise_parser
=
ConfigParser
.
RawConfigParser
()
promise_parser
.
add_section
(
'portal_templates'
)
promise_parser
.
set
(
'portal_templates'
,
'repository'
,
self
.
options
[
'bt5-repository-url'
])
promise_parser
.
set
(
'portal_templates'
,
'expected_bt5'
,
self
.
options
[
'bt5'
])
promise_parser
.
add_section
(
'external_service'
)
promise_parser
.
set
(
'external_service'
,
'cloudooo_url'
,
self
.
options
[
'cloudooo-url'
])
promise_parser
.
set
(
'external_service'
,
'memcached_url'
,
self
.
options
[
'memcached-url'
])
promise_parser
.
set
(
'external_service'
,
'kumofs_url'
,
self
.
options
[
'kumofs-url'
])
promise_parser
.
set
(
'external_service'
,
'smtp_url'
,
self
.
options
[
'smtp-url'
])
for
section_name
,
option_id_list
in
(
(
'portal_templates'
,
(
(
'repository'
,
'bt5-repository-url'
),
(
'expected_bt5'
,
'bt5'
),
)),
(
'external_service'
,
(
(
'cloudooo_url'
,
'cloudooo-url'
),
(
'memcached_url'
,
'memcached-url'
),
(
'kumofs_url'
,
'kumofs-url'
),
(
'smtp_url'
,
'smtp-url'
),
)),
):
promise_parser
.
add_section
(
section_name
)
for
internal_id
,
option_id
in
option_id_list
:
option
=
self
.
options
.
get
(
option_id
)
if
option
:
promise_parser
.
set
(
section_name
,
internal_id
,
option
)
promise_parser
.
write
(
open
(
self
.
options
[
'promise-path'
],
'w'
))
return
[
self
.
options
[
'promise-path'
]]
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