Commit de416ee9 authored by Julien Muchembled's avatar Julien Muchembled

Use new slapos.recipe.template for more information when an assertion fails

parent da7434dd
No related merge requests found
{% macro assert(x) %}{{ ("",)[not x] }}{% endmacro -%}
{% macro section(name) %}{% do part_list.append(name) %}{{ name }}{% endmacro -%} {% macro section(name) %}{% do part_list.append(name) %}{{ name }}{% endmacro -%}
{% set part_list = [] -%} {% set part_list = [] -%}
{% set section_id_list = [] -%} {% set section_id_list = [] -%}
......
...@@ -41,7 +41,7 @@ scripts = ...@@ -41,7 +41,7 @@ scripts =
[cluster] [cluster]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:_buildout_section_name_}.cfg.in url = ${:_profile_base_location_}/${:_buildout_section_name_}.cfg.in
md5sum = 02d7d576ef30f7d440b703d6fc57866a md5sum = 13f668f6e39eb75b2a2dfe2af0401f9b
# XXX: following mode should be the default # XXX: following mode should be the default
mode = 644 mode = 644
......
...@@ -296,7 +296,7 @@ extra-context = ...@@ -296,7 +296,7 @@ extra-context =
[template-erp5] [template-erp5]
< = download-base < = download-base
filename = instance-erp5.cfg.in filename = instance-erp5.cfg.in
md5sum = 675c7a5cfc24153889f0803ed6eb5f7e md5sum = 55ccb85dd3334d6c07b49a6f1c11ace9
[template-zeo] [template-zeo]
< = download-base < = download-base
...@@ -683,7 +683,7 @@ python-memcached = 1.54 ...@@ -683,7 +683,7 @@ python-memcached = 1.54
qrcode = 5.1 qrcode = 5.1
restkit = 4.2.2 restkit = 4.2.2
rtjp-eventlet = 0.3.2 rtjp-eventlet = 0.3.2
slapos.recipe.template = 2.7 slapos.recipe.template = 2.8
slapos.toolbox = 0.48 slapos.toolbox = 0.48
smmap = 0.9.0 smmap = 0.9.0
socketpool = 0.5.3 socketpool = 0.5.3
......
{% macro assert(x) %}{{ ("",)[not x] }}{% endmacro -%}
{% set sla_dict = {} -%} {% set sla_dict = {} -%}
{% for sla, ref_list in slapparameter_dict.get('sla-dict', {}).iteritems() -%} {% for sla, ref_list in slapparameter_dict.get('sla-dict', {}).iteritems() -%}
{% do sla_dict.update(dict.fromkeys(ref_list, sla)) -%} {% do sla_dict.update(dict.fromkeys(ref_list, sla)) -%}
...@@ -59,7 +58,7 @@ config-{{ k }} = {{ dumps(v) }} ...@@ -59,7 +58,7 @@ config-{{ k }} = {{ dumps(v) }}
{% for zodb in slapparameter_dict.get('zodb') or ({'type': 'zeo', 'server': {}},) -%} {% for zodb in slapparameter_dict.get('zodb') or ({'type': 'zeo', 'server': {}},) -%}
{% do mountpoints.add(zodb.setdefault('mount-point', '/')) -%} {% do mountpoints.add(zodb.setdefault('mount-point', '/')) -%}
{% set name = zodb.pop('name', 'root') -%} {% set name = zodb.pop('name', 'root') -%}
{% do assert(name not in zodb_dict) -%} {% do assert(name not in zodb_dict, name, zodb_dict) -%}
{% do zodb_dict.__setitem__(name, zodb) -%} {% do zodb_dict.__setitem__(name, zodb) -%}
{% if 'server' in zodb -%} {% if 'server' in zodb -%}
{% do storage_dict.setdefault(zodb['type'], {}).__setitem__(name, zodb.pop('server')) -%} {% do storage_dict.setdefault(zodb['type'], {}).__setitem__(name, zodb.pop('server')) -%}
...@@ -67,7 +66,7 @@ config-{{ k }} = {{ dumps(v) }} ...@@ -67,7 +66,7 @@ config-{{ k }} = {{ dumps(v) }}
{% endfor -%} {% endfor -%}
{% do assert(len(mountpoints) == len(zodb_dict)) %} {% do assert(len(mountpoints) == len(zodb_dict)) %}
{% for server_type, server_dict in storage_dict.iteritems() -%} {% for server_type, server_dict in storage_dict.iteritems() -%}
{% do assert(server_type == 'zeo') -%} {% do assert(server_type == 'zeo', server_type) -%}
{# BBB: for compatibility, keep 'zodb' as partition_reference for ZEO -#} {# BBB: for compatibility, keep 'zodb' as partition_reference for ZEO -#}
{{ request('zodb', 'zodb-' ~ server_type, 'zodb-' ~ server_type, {'tcpv4-port': 2100, 'zodb-dict': server_dict}, dict.fromkeys(('storage-dict', 'tidstorage-ip', 'tidstorage-port'))) }} {{ request('zodb', 'zodb-' ~ server_type, 'zodb-' ~ server_type, {'tcpv4-port': 2100, 'zodb-dict': server_dict}, dict.fromkeys(('storage-dict', 'tidstorage-ip', 'tidstorage-port'))) }}
{% endfor -%} {% endfor -%}
...@@ -214,4 +213,4 @@ hosts-dict = {{ '${' ~ zope_address_list_id_dict.keys()[0] ~ ':connection-hosts- ...@@ -214,4 +213,4 @@ hosts-dict = {{ '${' ~ zope_address_list_id_dict.keys()[0] ~ ':connection-hosts-
[buildout] [buildout]
parts = publish parts = publish
{{- assert(not sla_dict) }} {{- assert(not sla_dict, sla_dict) }}
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