Commit 7a8f604d authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 4b896eeb
......@@ -26,7 +26,7 @@
{#- XXX what to return ? #}
{%- else %}
{%- do seen.append(cell_ref) %}
{%- set ru = J(cell['_'])['ru'] %}
{%- set ru = cell['_']['ru'] %}
{%- if ru['ru_type'] == 'ru_ref' %}
{{- ru['ru_ref'] | tojson }}
{%- elif ru['ru_type'] == 'ruincell_ref' %}
......@@ -57,11 +57,13 @@
{#- cell_dict keeps cell slave instances: reference -> cell #}
{#- ru_dict keeps RU slave instances + RU whose definition is embedded into a cell: reference -> RU #}
{#- in the kept instances _ is automatically json-decoded #}
{%- set cell_dict = {} %}
{%- set ru_dict = {} %}
{%- for slave in slap_configuration.get('slave-instance-list', []) %}
{%- set ref = J(jref_of_shared(slave)) %}
{%- set _ = J(slave['_']) %}
{%- do slave.update({'_': _}) %}
{%- if 'ru_type' in _ %}
{%- do ru_dict.update({ref: slave}) %}
{%- elif 'cell_type' in _ %}
......@@ -69,7 +71,11 @@
{%- set ru = _['ru'] %}
{%- if ru['ru_type'] not in ('ru_ref', 'ruincell_ref') %}
{#- embedded ru definition -> expose it as `_<cell_ref>_ru` #}
{%- do ru_dict.update({'_%s_ru' % ref: ru}) %}
{%- do ru_dict.update({'_%s_ru' % ref: {
'_': ru,
'slave_title': '%s. RU' % slave['slave_title'],
'slave_reference': slave['slave_reference'],
}}) %}
{%- endif %}
{%- else %}
{%- do error(slave, "unknown shared instance type") %}
......
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