Commit 20c649eb authored by Romain Courteaud's avatar Romain Courteaud

Allow to propagate multilines parameter

parent 3fe2bfbd
......@@ -31,10 +31,6 @@ from slapos import slap as slapmodule
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):
self.logger = logging.getLogger(name)
......@@ -67,11 +63,14 @@ class Recipe(object):
filter_kw = {}
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 = {}
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,
options['name'], partition_parameter_kw=partition_parameter_kw,
......
......@@ -20,8 +20,8 @@ offline = true
[request-common]
recipe = slapos.cookbook:request
software-url = $${slap-connection:software-release-url}
sla =
computer_guid=$${slap-connection:computer-id}
sla = computer_guid
sla-computer_guid = $${slap-connection:computer-id}
return = url
server-url = $${slap-connection:server-url}
key-file = $${slap-connection:key-file}
......@@ -52,8 +52,8 @@ software-type = kumofs
[request-tidstorage]
<=request-common
name = TidStorage
config =
json=$${slap-parameter:json}
config = json
config-json = $${slap-parameter:json}
software-type = tidstorage
# rest of parts are candidates for some generic stuff
......
......@@ -74,7 +74,7 @@ mode = 0644
[template-erp5-production]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-erp5-production.cfg
md5sum = 25bd7e8dfa2d7588c6c2c648cd291b47
md5sum = 1c7a514854edab9cf92c28f2951147d5
output = ${buildout:directory}/template-erp5-production.cfg
mode = 0644
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment