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 ...@@ -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,
......
...@@ -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
......
...@@ -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
......
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