Commit c21af464 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 7ceda87f
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
{# ru_dict keeps RU slave instances + RU whose definition is embedded into a cell: reference -> RU #} {# ru_dict keeps RU slave instances + RU whose definition is embedded into a cell: reference -> RU #}
{% set cell_dict = {} %} {% set cell_dict = {} %}
{% set ru_dict = {} %} {% set ru_dict = {} %}
{%- for slave in slave_instance_list %} {%- for slave in slap_configuration.get('slave_instance_list', []) %}
{%- set ref = J(jref_of_shared(slave)) %} {%- set ref = J(jref_of_shared(slave)) %}
{%- set _ = J(slave['_']) %} {%- set _ = J(slave['_']) %}
{%- if 'ru_type' in _ %} {%- if 'ru_type' in _ %}
...@@ -67,16 +67,16 @@ ...@@ -67,16 +67,16 @@
{# jref_of_shared returns original reference used to request shared instance. {# jref_of_shared returns original reference used to request shared instance.
it is extracted from slave_reference which is composed as <partition_id>_<reference>. #} it is extracted from slave_reference which is composed as <partition_id>_<reference>. #}
{%- macro jref_of_shared(slave) %} {%- macro jref_of_shared(slave) %}
{%- set ref = slave['slave_reference'] %} {%- set ref = slave['slave_reference'] %}
{%- set partition_id %}{{partition_id}}{%- endset %} {%- set partition_id = slap_configuration['partition'] %}
{%- if ref.startswith(partition_id) %} {%- if ref.startswith(partition_id) %}
{%- set ref = ref[len(partition_id):] %} {%- set ref = ref[len(partition_id):] %}
{%- endif %} {%- endif %}
{%- if ref.startswith('_') %} {%- if ref.startswith('_') %}
{%- set ref = ref[1:] %} {%- set ref = ref[1:] %}
{%- endif %} {%- endif %}
{{ ref | tojson }} {{ ref | tojson }}
{%- endmacro %} {%- endmacro %}
......
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