Commit 08606022 authored by Vincent Pelletier's avatar Vincent Pelletier

erp5: Fail instanciating balancer if any family has no known backend.

parent b41a45ac
...@@ -314,7 +314,7 @@ link-binary = ...@@ -314,7 +314,7 @@ link-binary =
[template-balancer] [template-balancer]
< = download-base < = download-base
filename = instance-balancer.cfg.in filename = instance-balancer.cfg.in
md5sum = 722ce9bfd981aa6a246e595902086b65 md5sum = 2d2bd66f5771e106ce31253e01162ff3
[template-haproxy-cfg] [template-haproxy-cfg]
< = download-base < = download-base
......
...@@ -48,6 +48,13 @@ ipv6 = {{ zope_address.split(']:')[0][1:] }} ...@@ -48,6 +48,13 @@ ipv6 = {{ zope_address.split(']:')[0][1:] }}
{% do zope_family_address_list.append((zope_effective_address, maxconn)) -%} {% do zope_family_address_list.append((zope_effective_address, maxconn)) -%}
{% endfor -%} {% endfor -%}
{% endfor -%} {% endfor -%}
{# Make rendering fail artificially if any family has no known backend.
# This is useful as haproxy's hot-reconfiguration mechanism is
# supervisord-incompatible.
# As jinja2 postpones KeyError until place-holder value is actually used,
# do a no-op, type-safe concatenation.
-#}
{% do '#' ~ zope_family_address_list[0] -%}
{% set haproxy_port = next_port -%} {% set haproxy_port = next_port -%}
{% set next_port = next_port + 1 -%} {% set next_port = next_port + 1 -%}
{% do haproxy_dict.__setitem__(family_name, (haproxy_port, zope_family_address_list)) -%} {% do haproxy_dict.__setitem__(family_name, (haproxy_port, zope_family_address_list)) -%}
......
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