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
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
Stephane VAROQUI
slapos
Commits
20c649eb
Commit
20c649eb
authored
Oct 19, 2011
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow to propagate multilines parameter
parent
3fe2bfbd
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
11 deletions
+10
-11
slapos/recipe/request.py
slapos/recipe/request.py
+5
-6
software/erp5/instance-erp5-production.cfg
software/erp5/instance-erp5-production.cfg
+4
-4
software/erp5/software.cfg
software/erp5/software.cfg
+1
-1
No files found.
slapos/recipe/request.py
View file @
20c649eb
...
@@ -31,10 +31,6 @@ from slapos import slap as slapmodule
...
@@ -31,10 +31,6 @@ from slapos import slap as slapmodule
class
Recipe
(
object
):
class
Recipe
(
object
):
def
parseMultiValues
(
self
,
string
):
return
dict
([
[
str
(
column
).
strip
()
for
column
in
line
.
split
(
'='
,
1
)]
for
line
in
str
(
string
).
splitlines
()
if
'='
in
line
])
def
__init__
(
self
,
buildout
,
name
,
options
):
def
__init__
(
self
,
buildout
,
name
,
options
):
self
.
logger
=
logging
.
getLogger
(
name
)
self
.
logger
=
logging
.
getLogger
(
name
)
...
@@ -67,11 +63,14 @@ class Recipe(object):
...
@@ -67,11 +63,14 @@ class Recipe(object):
filter_kw
=
{}
filter_kw
=
{}
if
'sla'
in
options
:
if
'sla'
in
options
:
filter_kw
=
self
.
parseMultiValues
(
options
[
'sla'
])
for
sla_parameter
in
options
[
'sla'
].
split
():
filter_kw
[
sla_parameter
]
=
options
[
'sla-%s'
%
sla_parameter
]
partition_parameter_kw
=
{}
partition_parameter_kw
=
{}
if
'config'
in
options
:
if
'config'
in
options
:
partition_parameter_kw
=
self
.
parseMultiValues
(
options
[
'config'
])
for
config_parameter
in
options
[
'config'
].
split
():
partition_parameter_kw
[
config_parameter
]
=
\
options
[
'config-%s'
%
config_parameter
]
instance
=
self
.
request
(
options
[
'software-url'
],
software_type
,
instance
=
self
.
request
(
options
[
'software-url'
],
software_type
,
options
[
'name'
],
partition_parameter_kw
=
partition_parameter_kw
,
options
[
'name'
],
partition_parameter_kw
=
partition_parameter_kw
,
...
...
software/erp5/instance-erp5-production.cfg
View file @
20c649eb
...
@@ -20,8 +20,8 @@ offline = true
...
@@ -20,8 +20,8 @@ offline = true
[request-common]
[request-common]
recipe = slapos.cookbook:request
recipe = slapos.cookbook:request
software-url = $${slap-connection:software-release-url}
software-url = $${slap-connection:software-release-url}
sla =
sla =
computer_guid
computer_guid=
$${slap-connection:computer-id}
sla-computer_guid =
$${slap-connection:computer-id}
return = url
return = url
server-url = $${slap-connection:server-url}
server-url = $${slap-connection:server-url}
key-file = $${slap-connection:key-file}
key-file = $${slap-connection:key-file}
...
@@ -52,8 +52,8 @@ software-type = kumofs
...
@@ -52,8 +52,8 @@ software-type = kumofs
[request-tidstorage]
[request-tidstorage]
<=request-common
<=request-common
name = TidStorage
name = TidStorage
config =
config =
json
json=
$${slap-parameter:json}
config-json =
$${slap-parameter:json}
software-type = tidstorage
software-type = tidstorage
# rest of parts are candidates for some generic stuff
# rest of parts are candidates for some generic stuff
...
...
software/erp5/software.cfg
View file @
20c649eb
...
@@ -74,7 +74,7 @@ mode = 0644
...
@@ -74,7 +74,7 @@ mode = 0644
[template-erp5-production]
[template-erp5-production]
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-erp5-production.cfg
url = ${:_profile_base_location_}/instance-erp5-production.cfg
md5sum =
25bd7e8dfa2d7588c6c2c648cd291b47
md5sum =
1c7a514854edab9cf92c28f2951147d5
output = ${buildout:directory}/template-erp5-production.cfg
output = ${buildout:directory}/template-erp5-production.cfg
mode = 0644
mode = 0644
...
...
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