Commit ea8b625f authored by Łukasz Nowak's avatar Łukasz Nowak

stack/resilient: Be python3 friendly

parent fb053d19
...@@ -30,7 +30,7 @@ md5sum = 44a3166048a81d0d76d69527b1934ef7 ...@@ -30,7 +30,7 @@ md5sum = 44a3166048a81d0d76d69527b1934ef7
[template-replicated] [template-replicated]
filename = template-replicated.cfg.in filename = template-replicated.cfg.in
md5sum = c4012ccc2c473ae5c7cad9dcac61e0f1 md5sum = 2eea3b0227c3ae9e44cfc41df9930fa7
[template-parts] [template-parts]
filename = template-parts.cfg.in filename = template-parts.cfg.in
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
{% set monitor_url_list = [] -%} {% set monitor_url_list = [] -%}
# prepare sla-parameters # prepare sla-parameters
{% if slapparameter_dict is defined -%} {% if slapparameter_dict is defined -%}
{% for key in slapparameter_dict.keys() -%} {% for key in list(slapparameter_dict.keys()) -%}
{% if key.startswith('-sla-') -%} {% if key.startswith('-sla-') -%}
{% do sla_parameter_dict.__setitem__(key, slapparameter_dict.pop(key)) -%} {% do sla_parameter_dict.__setitem__(key, slapparameter_dict.pop(key)) -%}
{% endif -%} {% endif -%}
...@@ -59,7 +59,7 @@ sla-mode = unique_by_network ...@@ -59,7 +59,7 @@ sla-mode = unique_by_network
{% for key in sla_parameter_dict.keys() -%} {% for key in sla_parameter_dict.keys() -%}
{% if key.startswith(sla_key_main) -%} {% if key.startswith(sla_key_main) -%}
{% do sla_dict.__setitem__(key[sla_key_main_length:], sla_parameter_dict.get(key)) -%} {% do sla_dict.__setitem__(key[sla_key_main_length:], sla_parameter_dict.get(key)) -%}
{% elif key.startswith(sla_key_secondary) and not sla_dict.has_key(key[sla_key_secondary_length:]) -%} {% elif key.startswith(sla_key_secondary) and key[sla_key_secondary_length:] not in sla_dict -%}
{% 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 -%}
...@@ -111,7 +111,7 @@ sla-mode = unique_by_network ...@@ -111,7 +111,7 @@ sla-mode = unique_by_network
{% for key in sla_parameter_dict.keys() -%} {% for key in sla_parameter_dict.keys() -%}
{% if key.startswith(sla_key_main) -%} {% if key.startswith(sla_key_main) -%}
{% do sla_dict.__setitem__(key[sla_key_main_length:], sla_parameter_dict.get(key)) -%} {% do sla_dict.__setitem__(key[sla_key_main_length:], sla_parameter_dict.get(key)) -%}
{% elif key.startswith(sla_key_secondary) and not sla_dict.has_key(key[sla_key_secondary_length:]) -%} {% elif key.startswith(sla_key_secondary) and key[sla_key_secondary_length:] not in sla_dict -%}
{% 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 -%}
...@@ -214,7 +214,7 @@ sla-mode = unique_by_network ...@@ -214,7 +214,7 @@ sla-mode = unique_by_network
{% for key in sla_parameter_dict.keys() -%} {% for key in sla_parameter_dict.keys() -%}
{% if key.startswith(sla_key_main) -%} {% if key.startswith(sla_key_main) -%}
{% do sla_dict.__setitem__(key[sla_key_main_length:], sla_parameter_dict.get(key)) -%} {% do sla_dict.__setitem__(key[sla_key_main_length:], sla_parameter_dict.get(key)) -%}
{% elif key.startswith(sla_key_secondary) and not sla_dict.has_key(key[sla_key_secondary_length:]) -%} {% elif key.startswith(sla_key_secondary) and key[sla_key_secondary_length:] not in sla_dict -%}
{% 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 -%}
......
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