Commit e92da066 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent 6a81e608
......@@ -70,17 +70,7 @@
cpri_rx_delay: "{{ vcpri | map(attribute='rx_delay') | map('default', '') | join(',') }}",
cpri_tx_delay: "{{ vcpri | map(attribute='tx_delay') | map('default', '') | join(',') }}",
cpri_tx_dbm: "{{ vcpri | map(attribute='tx_dbm') | map('default', '') | join(',') }}",
{%- set tap_base = slap_configuration.get('tap-name', '') %}
{%- set vtap = ['']*len(dev_argv) %}
{%- for i, (dev, _) in enumerate(ru_cpri_dict|dictsort) %}
{%- if len(ru_cpri_dict) > 1 %}
{%- set tap = "%s-%d" % (tap_base, i+1) %}
{%- else %}
{%- set tap = tap_base %}
{%- endif %}
{%- do vtap.__setitem__(dev, tap) %}
{%- endfor %}
ifname: "{{ vtap | join(',') }}",
ifname: "{{ vcpri | map(attribute='_tap') | map('default', '') | join(',') }}",
{%- endif %}
},
......
......@@ -233,8 +233,17 @@
{%- endfor %}
{#- assign TAP interfaces to cpri RUs #}
{%- set iru_vcpri = list(iru_dict.values() | selectattr('_.ru_link_type', '==', 'cpri')) %}
{%- do print('ncpri:'), pprint(len(iru_vcpri)) %}
{%- set iru_vcpri = list(iru_dict|dictsort | selectattr('1._.ru_link_type', '==', 'cpri')) %}
{%- do print('ncpri:'), pprint(len(iru_vcpri)) %}
{%- set tap_base = slap_configuration.get('tap-name', '') %}
{%- for i, (ru_ref, iru) in enumerate(iru_vcpri) %}
{%- if len(iru_vcpri) > 1 %}
{%- set tap = "%s-%d" % (tap_base, i+1) %}
{%- else %}
{%- set tap = tap_base %}
{%- endif %}
{%- do iru._.cpri_link.update({'_tap': tap}) %}
{%- endfor %}
{%- 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