Commit 5962ca5c authored by Saurabh's avatar Saurabh Committed by Julien Muchembled

NEO: new 'sla-dict' instanciation parameter, working like for ERP5

parent ef1359e6
......@@ -2,10 +2,14 @@
{% macro section(name) %}{% do part_list.append(name) %}{{ name }}{% endmacro -%}
{% set part_list = [] -%}
{% set section_id_list = [] -%}
{% set sla_dict = {} -%}
{% for sla, ref_list in slapparameter_dict.get('sla-dict', {}).iteritems() -%}
{% do sla_dict.update(dict.fromkeys(ref_list, sla)) -%}
{% endfor -%}
[request-common]
recipe = slapos.cookbook:request.serialised
software-url = ${slap-connection:software-release-url}
sla-computer_guid = ${slap-connection:computer-id}
server-url = ${slap-connection:server-url}
key-file = ${slap-connection:key-file}
cert-file = ${slap-connection:cert-file}
......@@ -19,6 +23,16 @@ config-upstream-cluster = {{ dumps(slapparameter_dict.get('upstream-cluster', ''
config-upstream-masters = {{ dumps(slapparameter_dict.get('upstream-masters', '')) }}
software-type = neo
{% macro sla(name) -%}
{% if name in sla_dict -%}
{% for k, (v,) in urlparse.parse_qs(sla_dict.pop(name), strict_parsing=1).iteritems() -%}
sla-{{ k }} = {{ v }}
{% endfor -%}
{% else -%}
sla-computer_guid = ${slap-connection:computer-id}
{% endif -%}
{% endmacro -%}
[publish]
recipe = slapos.cookbook:publish.serialised
masters = ${node-0-final:connection-masters}
......@@ -35,6 +49,7 @@ name = {{ section_id }}
{% for k, v in node.iteritems() -%}
config-{{ k }} = {{ dumps(v) }}
{% endfor -%}
{{ sla(section_id) }}
[{{ section_id }}]
<= request-common
......
......@@ -26,6 +26,8 @@ context =
[neo-cluster]
<= jinja2-template-base
template = {{ cluster }}
extra-context =
import urlparse urlparse
[neo-admin]
<= jinja2-template-base
......
......@@ -41,7 +41,7 @@ scripts =
[cluster]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_buildout_section_name_}.cfg.in
md5sum = 5e422ddd4ecfe85daa3e151cde261c75
md5sum = 02d7d576ef30f7d440b703d6fc57866a
# XXX: following mode should be the default
mode = 644
......@@ -65,7 +65,7 @@ md5sum = febd3ed58043ce1367b86cf6e4e69700
[template]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg.in
md5sum = 6101da4361793eddde62b6be1639c25e
md5sum = e0917a4a4aa102d6fa4274530d56959e
# XXX: "template.cfg" is hardcoded in instanciation recipe
rendered = ${buildout:directory}/template.cfg
context =
......
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