Commit 9311f4f6 authored by Łukasz Nowak's avatar Łukasz Nowak Committed by Thomas Gambier

stack/resilient: Fix unique_by_network SLA

The SLA unique_by_network was not requested at all when any SLA was set
in the resilience. Now we put unique_by_network for all instances
without SLA.
parent 4637b0cb
...@@ -30,7 +30,7 @@ md5sum = 1b8645835f04081861266436505fd28f ...@@ -30,7 +30,7 @@ md5sum = 1b8645835f04081861266436505fd28f
[template-replicated] [template-replicated]
filename = template-replicated.cfg.in filename = template-replicated.cfg.in
md5sum = 52762882e0d631f51d2c9e5f8b31c0b6 md5sum = 67c863b15dbfa937babdbd620f95c1ff
[template-parts] [template-parts]
filename = template-parts.cfg.in filename = template-parts.cfg.in
......
...@@ -48,9 +48,6 @@ config-{{ parameter_name }} = {{ dumps(parameter_value) }} ...@@ -48,9 +48,6 @@ config-{{ parameter_name }} = {{ dumps(parameter_value) }}
{% for key, value in six.iteritems(monitor_dict) -%} {% for key, value in six.iteritems(monitor_dict) -%}
config-{{ key }} = {{ value }} config-{{ key }} = {{ value }}
{% endfor -%} {% endfor -%}
{% if sla_parameter_dict == {} -%}
sla-mode = unique_by_network
{% else %}
{% set sla_key_main = "-sla-%s%s-" % (namebase, 0) -%} {% set sla_key_main = "-sla-%s%s-" % (namebase, 0) -%}
{% set sla_key_secondary = "-sla-%s-" % (0) -%} {% set sla_key_secondary = "-sla-%s-" % (0) -%}
{% set sla_key_main_length = sla_key_main | length -%} {% set sla_key_main_length = sla_key_main | length -%}
...@@ -63,10 +60,13 @@ sla-mode = unique_by_network ...@@ -63,10 +60,13 @@ sla-mode = unique_by_network
{% do sla_dict.__setitem__(key[sla_key_secondary_length:], sla_parameter_dict.get(key)) -%} {% do sla_dict.__setitem__(key[sla_key_secondary_length:], sla_parameter_dict.get(key)) -%}
{% endif -%} {% endif -%}
{% endfor -%} {% endfor -%}
{% if sla_dict == {} %}
sla-mode = unique_by_network
{% else %}
{% for key, value in six.iteritems(sla_dict) -%} {% for key, value in six.iteritems(sla_dict) -%}
sla-{{ key }} = {{ value }} sla-{{ key }} = {{ value }}
{% endfor -%} {% endfor %}
{% endif -%} {% endif %}
{% if 'monitor-base-url' in monitor_return and not monitor_parameter_dict.get('set-monitor-url', False) -%} {% if 'monitor-base-url' in monitor_return and not monitor_parameter_dict.get('set-monitor-url', False) -%}
{% do monitor_url_list.append('${request-' ~ namebase ~ ':connection-monitor-base-url}') -%} {% do monitor_url_list.append('${request-' ~ namebase ~ ':connection-monitor-base-url}') -%}
...@@ -100,9 +100,6 @@ config-on-notification = ${request-pbs-{{namebase}}-{{id}}:connection-feeds-url} ...@@ -100,9 +100,6 @@ config-on-notification = ${request-pbs-{{namebase}}-{{id}}:connection-feeds-url}
{% for key, value in six.iteritems(monitor_dict) -%} {% for key, value in six.iteritems(monitor_dict) -%}
config-{{ key }} = {{ value }} config-{{ key }} = {{ value }}
{% endfor -%} {% endfor -%}
{% if sla_parameter_dict == {} -%}
sla-mode = unique_by_network
{% else %}
{% set sla_key_main = "-sla-%s%s-" % (namebase, id) -%} {% set sla_key_main = "-sla-%s%s-" % (namebase, id) -%}
{% set sla_key_secondary = "-sla-%s-" % (id) -%} {% set sla_key_secondary = "-sla-%s-" % (id) -%}
{% set sla_key_main_length = sla_key_main | length -%} {% set sla_key_main_length = sla_key_main | length -%}
...@@ -115,9 +112,12 @@ sla-mode = unique_by_network ...@@ -115,9 +112,12 @@ sla-mode = unique_by_network
{% do sla_dict.__setitem__(key[sla_key_secondary_length:], sla_parameter_dict.get(key)) -%} {% do sla_dict.__setitem__(key[sla_key_secondary_length:], sla_parameter_dict.get(key)) -%}
{% endif -%} {% endif -%}
{% endfor -%} {% endfor -%}
{% if sla_dict == {} %}
sla-mode = unique_by_network
{% else %}
{% for key, value in six.iteritems(sla_dict) -%} {% for key, value in six.iteritems(sla_dict) -%}
sla-{{ key }} = {{ value }} sla-{{ key }} = {{ value }}
{% endfor -%} {% endfor %}
{% endif %} {% endif %}
[publish-connection-information] [publish-connection-information]
...@@ -202,9 +202,6 @@ config-{{ key }} = {{ value }} ...@@ -202,9 +202,6 @@ config-{{ key }} = {{ value }}
{% endfor -%} {% endfor -%}
return = ssh-key notification-url feeds-url {{ monitor_return }} return = ssh-key notification-url feeds-url {{ monitor_return }}
shared = false shared = false
{% if sla_parameter_dict == {} -%}
sla-mode = unique_by_network
{% else %}
{% set sla_key_main = "-sla-%s%s-" % ("pbs", id) -%} {% set sla_key_main = "-sla-%s%s-" % ("pbs", id) -%}
{% set sla_key_secondary = "-sla-%s-" % (id) -%} {% set sla_key_secondary = "-sla-%s-" % (id) -%}
{% set sla_key_main_length = sla_key_main | length -%} {% set sla_key_main_length = sla_key_main | length -%}
...@@ -217,6 +214,9 @@ sla-mode = unique_by_network ...@@ -217,6 +214,9 @@ sla-mode = unique_by_network
{% do sla_dict.__setitem__(key[sla_key_secondary_length:], sla_parameter_dict.get(key)) -%} {% do sla_dict.__setitem__(key[sla_key_secondary_length:], sla_parameter_dict.get(key)) -%}
{% endif -%} {% endif -%}
{% endfor -%} {% endfor -%}
{% if sla_dict == {} %}
sla-mode = unique_by_network
{% else %}
{% for key, value in six.iteritems(sla_dict) -%} {% for key, value in six.iteritems(sla_dict) -%}
sla-{{ key }} = {{ value }} sla-{{ key }} = {{ value }}
{% endfor %} {% endfor %}
......
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