From d03e741f7f4d01877157df4adc1d59844cb91594 Mon Sep 17 00:00:00 2001 From: Shivani-gslab Date: Wed, 21 Aug 2024 19:32:13 +0530 Subject: [PATCH] Fixing the bugs --- .../devices/ethernet-interfaces.md | 2 +- .../devices/port-channel-interfaces.md | 2 +- .../documentation/ethernet-interfaces.j2 | 4 +- .../documentation/port-channel-interfaces.j2 | 4 +- .../j2templates/eos/ethernet-interfaces.j2 | 40 ++++++++---------- .../eos/port-channel-interfaces.j2 | 41 ++++++++----------- 6 files changed, 42 insertions(+), 51 deletions(-) diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/ethernet-interfaces.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/ethernet-interfaces.md index 773a930ef35..5ed4c654b86 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/ethernet-interfaces.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/ethernet-interfaces.md @@ -180,7 +180,7 @@ sFlow is disabled. | Ethernet1 | both | 43 | 30 | - | - | - | True | | Ethernet1 | in | 10 | 24 | - | - | - | - | | Ethernet1 | in | 23 | 45 | - | - | - | True | -| Ethernet1 | in | 37 | 49 | - | - | - | - | +| Ethernet1 | in | 37 | 49 | 56 | - | - | - | | Ethernet1 | out | 10 | 45 | - | 34 | - | - | | Ethernet1 | out | 34 | 50 | - | - | - | - | | Ethernet1 | out | 45 | True | - | - | - | True | diff --git a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/port-channel-interfaces.md b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/port-channel-interfaces.md index 32780d50008..216c9a60d31 100644 --- a/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/port-channel-interfaces.md +++ b/ansible_collections/arista/avd/molecule/eos_cli_config_gen/documentation/devices/port-channel-interfaces.md @@ -282,7 +282,7 @@ interface Ethernet50 | Port-Channel100 | both | 43 | 30 | - | - | - | True | | Port-Channel100 | in | 23 | 45 | - | - | - | True | | Port-Channel100 | in | 34 | 23 | - | - | - | - | -| Port-Channel100 | in | 37 | 49 | - | - | - | - | +| Port-Channel100 | in | 37 | 49 | - | 56 | - | - | | Port-Channel100 | out | 10 | 45 | - | 34 | - | - | | Port-Channel100 | out | 34 | 50 | - | - | - | - | | Port-Channel100 | out | 45 | True | - | - | - | True | diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/ethernet-interfaces.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/ethernet-interfaces.j2 index f9f8eaf4dd8..395725b0d5a 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/ethernet-interfaces.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/ethernet-interfaces.j2 @@ -195,10 +195,10 @@ {% for ethernet_interface in ethernet_interfaces | arista.avd.natural_sort('name') %} {% if ethernet_interface.switchport.vlan_translations is arista.avd.defined %} {% for vlan_translation in ethernet_interface.switchport.vlan_translations.direction_both | arista.avd.natural_sort('from') %} -| {{ ethernet_interface.name }} | both | {{ vlan_translation.from }} | {{ vlan_translation.to | arista.avd.default('-') }} | {{ vlan_translation.inner_vlan_from | arista.avd.default('-') }} | - | {{ vlan_translation.network | arista.avd.default('-') }} | {{ vlan_translation.dot1q_tunnel | arista.avd.default('-') }} | +| {{ ethernet_interface.name }} | both | {{ vlan_translation.from }} | {{ vlan_translation.to }} | {{ vlan_translation.inner_vlan_from | arista.avd.default('-') }} | - | {{ vlan_translation.network | arista.avd.default('-') }} | {{ vlan_translation.dot1q_tunnel | arista.avd.default('-') }} | {% endfor %} {% for vlan_translation in ethernet_interface.switchport.vlan_translations.direction_in | arista.avd.natural_sort('from') %} -| {{ ethernet_interface.name }} | in | {{ vlan_translation.from }} | {{ vlan_translation.to | arista.avd.default('-') }} | - | {{ vlan_translation.inner_vlan_to | arista.avd.default('-') }} | {{ vlan_translation.network | arista.avd.default('-') }} | {{ vlan_translation.dot1q_tunnel | arista.avd.default('-') }} | +| {{ ethernet_interface.name }} | in | {{ vlan_translation.from }} | {{ vlan_translation.to }} | {{ vlan_translation.inner_vlan_from | arista.avd.default('-') }} | - | {{ vlan_translation.network | arista.avd.default('-') }} | {{ vlan_translation.dot1q_tunnel | arista.avd.default('-') }} | {% endfor %} {% for vlan_translation in ethernet_interface.switchport.vlan_translations.direction_out | arista.avd.natural_sort('from') %} {% set to_vlan_id = vlan_translation.dot1q_tunnel.all | arista.avd.default( vlan_translation.dot1q_tunnel.to, vlan_translation.to, "-") %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/port-channel-interfaces.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/port-channel-interfaces.j2 index cc686a5af14..b3e3d84d65f 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/port-channel-interfaces.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/documentation/port-channel-interfaces.j2 @@ -153,10 +153,10 @@ {% for port_channel_interface in port_channel_interfaces | arista.avd.natural_sort('name') %} {% if port_channel_interface.switchport.vlan_translations is arista.avd.defined %} {% for vlan_translation in port_channel_interface.switchport.vlan_translations.direction_both | arista.avd.natural_sort('from') %} -| {{ port_channel_interface.name }} | both | {{ vlan_translation.from }} | {{ vlan_translation.to | arista.avd.default('-') }} | {{ vlan_translation.inner_vlan_from | arista.avd.default('-') }} | - | {{ vlan_translation.network | arista.avd.default('-') }} | {{ vlan_translation.dot1q_tunnel | arista.avd.default('-') }} | +| {{ port_channel_interface.name }} | both | {{ vlan_translation.from }} | {{ vlan_translation.to }} | {{ vlan_translation.inner_vlan_from | arista.avd.default('-') }} | - | {{ vlan_translation.network | arista.avd.default('-') }} | {{ vlan_translation.dot1q_tunnel | arista.avd.default('-') }} | {% endfor %} {% for vlan_translation in port_channel_interface.switchport.vlan_translations.direction_in | arista.avd.natural_sort('from') %} -| {{ port_channel_interface.name }} | in | {{ vlan_translation.from }} | {{ vlan_translation.to | arista.avd.default('-') }} | - | {{ vlan_translation.inner_vlan_to | arista.avd.default('-') }} | {{ vlan_translation.network | arista.avd.default('-') }} | {{ vlan_translation.dot1q_tunnel | arista.avd.default('-') }} | +| {{ port_channel_interface.name }} | in | {{ vlan_translation.from }} | {{ vlan_translation.to }} | - | {{ vlan_translation.inner_vlan_from | arista.avd.default('-') }} | {{ vlan_translation.network | arista.avd.default('-') }} | {{ vlan_translation.dot1q_tunnel | arista.avd.default('-') }} | {% endfor %} {% for vlan_translation in port_channel_interface.switchport.vlan_translations.direction_out | arista.avd.natural_sort('from') %} {% set to_vlan_id = vlan_translation.dot1q_tunnel.all | arista.avd.default( vlan_translation.dot1q_tunnel.to, vlan_translation.to, "-") %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/ethernet-interfaces.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/ethernet-interfaces.j2 index 16a69038721..e6c066cdc88 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/ethernet-interfaces.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/ethernet-interfaces.j2 @@ -205,42 +205,38 @@ interface {{ ethernet_interface.name }} {% endif %} {% for vlan_translation in ethernet_interface.switchport.vlan_translations.direction_both | arista.avd.natural_sort('from') %} {% set vlan_translation_both_cli = 'switchport vlan translation' %} -{% if vlan_translation.from is arista.avd.defined and vlan_translation.to is arista.avd.defined %} -{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' ' ~ vlan_translation.from %} -{% if vlan_translation.dot1q_tunnel is arista.avd.defined(true) %} -{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' dot1q-tunnel' %} -{% elif vlan_translation.inner_vlan_from is arista.avd.defined %} -{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' inner ' ~ vlan_translation.inner_vlan_from %} -{% if vlan_translation.network is arista.avd.defined(true) %} -{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' network' %} -{% endif %} +{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' ' ~ vlan_translation.from %} +{% if vlan_translation.dot1q_tunnel is arista.avd.defined(true) %} +{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' dot1q-tunnel' %} +{% elif vlan_translation.inner_vlan_from is arista.avd.defined %} +{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' inner ' ~ vlan_translation.inner_vlan_from %} +{% if vlan_translation.network is arista.avd.defined(true) %} +{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' network' %} {% endif %} -{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' ' ~ vlan_translation.to %} - {{ vlan_translation_both_cli }} {% endif %} +{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' ' ~ vlan_translation.to %} + {{ vlan_translation_both_cli }} {% endfor %} {% if ethernet_interface.switchport.vlan_translations.direction_in is arista.avd.defined %} {% for vlan_translation in ethernet_interface.switchport.vlan_translations.direction_in %} -{% if vlan_translation.from is arista.avd.defined and vlan_translation.to is arista.avd.defined %} -{% set vlan_translation_in_cli = 'switchport vlan translation in ' ~ vlan_translation.from %} -{% if vlan_translation.dot1q_tunnel is arista.avd.defined(true) %} -{% set vlan_translation_in_cli = vlan_translation_in_cli ~ ' dot1q-tunnel' %} -{% elif vlan_translation.inner_vlan_from is arista.avd.defined %} -{% set vlan_translation_in_cli = vlan_translation_in_cli ~ ' inner ' ~ vlan_translation.inner_vlan_from %} -{% endif %} -{% set vlan_translation_in_cli = vlan_translation_in_cli ~ " " ~ vlan_translation.to %} - {{ vlan_translation_in_cli }} +{% set vlan_translation_in_cli = 'switchport vlan translation in ' ~ vlan_translation.from %} +{% if vlan_translation.dot1q_tunnel is arista.avd.defined(true) %} +{% set vlan_translation_in_cli = vlan_translation_in_cli ~ ' dot1q-tunnel' %} +{% elif vlan_translation.inner_vlan_from is arista.avd.defined %} +{% set vlan_translation_in_cli = vlan_translation_in_cli ~ ' inner ' ~ vlan_translation.inner_vlan_from %} {% endif %} +{% set vlan_translation_in_cli = vlan_translation_in_cli ~ " " ~ vlan_translation.to %} + {{ vlan_translation_in_cli }} {% endfor %} {% endif %} {% if ethernet_interface.switchport.vlan_translations.direction_out is arista.avd.defined %} {% for vlan_translation in ethernet_interface.switchport.vlan_translations.direction_out %} -{% if vlan_translation.from is arista.avd.defined and vlan_translation.to is arista.avd.defined %} +{% if vlan_translation.to is arista.avd.defined %} {% set vlan_translation_out_cli = 'switchport vlan translation out ' ~ vlan_translation.from ~ ' ' ~ vlan_translation.to %} {% if vlan_translation.inner_vlan_to is arista.avd.defined %} {% set vlan_translation_out_cli = vlan_translation_out_cli ~ ' inner ' ~ vlan_translation.inner_vlan_to %} {% endif %} -{% elif vlan_translation.from is arista.avd.defined and vlan_translation.dot1q_tunnel is arista.avd.defined %} +{% elif vlan_translation.dot1q_tunnel is arista.avd.defined %} {% set vlan_translation_out_cli = 'switchport vlan translation out ' ~ vlan_translation.from %} {% if vlan_translation.dot1q_tunnel.all is arista.avd.defined(true) %} {% set vlan_translation_out_cli = vlan_translation_out_cli ~ ' dot1q-tunnel all' %} diff --git a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/port-channel-interfaces.j2 b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/port-channel-interfaces.j2 index 1ed1f48c954..bc4dc14da47 100644 --- a/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/port-channel-interfaces.j2 +++ b/python-avd/pyavd/_eos_cli_config_gen/j2templates/eos/port-channel-interfaces.j2 @@ -153,43 +153,38 @@ interface {{ port_channel_interface.name }} {% endif %} {% for vlan_translation in port_channel_interface.switchport.vlan_translations.direction_both | arista.avd.natural_sort('from') %} {% set vlan_translation_both_cli = 'switchport vlan translation' %} -{% if vlan_translation.from is arista.avd.defined and vlan_translation.to is arista.avd.defined %} -{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' ' ~ vlan_translation.from %} -{% if vlan_translation.dot1q_tunnel is arista.avd.defined(true) %} -{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' dot1q-tunnel' %} -{% elif vlan_translation.inner_vlan_from is arista.avd.defined %} -{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' inner ' ~ vlan_translation.inner_vlan_from %} -{% if vlan_translation.network is arista.avd.defined(true) %} -{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' network' %} -{% endif %} +{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' ' ~ vlan_translation.from %} +{% if vlan_translation.dot1q_tunnel is arista.avd.defined(true) %} +{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' dot1q-tunnel' %} +{% elif vlan_translation.inner_vlan_from is arista.avd.defined %} +{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' inner ' ~ vlan_translation.inner_vlan_from %} +{% if vlan_translation.network is arista.avd.defined(true) %} +{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' network' %} {% endif %} -{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' ' ~ vlan_translation.to %} - {{ vlan_translation_both_cli }} {% endif %} +{% set vlan_translation_both_cli = vlan_translation_both_cli ~ ' ' ~ vlan_translation.to %} + {{ vlan_translation_both_cli }} {% endfor %} {% if port_channel_interface.switchport.vlan_translations.direction_in is arista.avd.defined %} {% for vlan_translation in port_channel_interface.switchport.vlan_translations.direction_in %} -{% set vlan_translation_in_cli = 'switchport vlan translation in' %} -{% if vlan_translation.from is arista.avd.defined and vlan_translation.to is arista.avd.defined %} -{% set vlan_translation_in_cli = 'switchport vlan translation in ' ~ vlan_translation.from %} -{% if vlan_translation.dot1q_tunnel is arista.avd.defined(true) %} -{% set vlan_translation_in_cli = vlan_translation_in_cli ~ ' dot1q-tunnel' %} -{% elif vlan_translation.inner_vlan_from is arista.avd.defined %} -{% set vlan_translation_in_cli = vlan_translation_in_cli ~ ' inner ' ~ vlan_translation.inner_vlan_from %} -{% endif %} -{% set vlan_translation_in_cli = vlan_translation_in_cli ~ " " ~ vlan_translation.to %} - {{ vlan_translation_in_cli }} +{% set vlan_translation_in_cli = 'switchport vlan translation in ' ~ vlan_translation.from %} +{% if vlan_translation.dot1q_tunnel is arista.avd.defined(true) %} +{% set vlan_translation_in_cli = vlan_translation_in_cli ~ ' dot1q-tunnel' %} +{% elif vlan_translation.inner_vlan_from is arista.avd.defined %} +{% set vlan_translation_in_cli = vlan_translation_in_cli ~ ' inner ' ~ vlan_translation.inner_vlan_from %} {% endif %} +{% set vlan_translation_in_cli = vlan_translation_in_cli ~ " " ~ vlan_translation.to %} + {{ vlan_translation_in_cli }} {% endfor %} {% endif %} {% if port_channel_interface.switchport.vlan_translations.direction_out is arista.avd.defined %} {% for vlan_translation in port_channel_interface.switchport.vlan_translations.direction_out %} -{% if vlan_translation.from is arista.avd.defined and vlan_translation.to is arista.avd.defined %} +{% if vlan_translation.to is arista.avd.defined %} {% set vlan_translation_out_cli = 'switchport vlan translation out ' ~ vlan_translation.from ~ ' ' ~ vlan_translation.to %} {% if vlan_translation.inner_vlan_to is arista.avd.defined %} {% set vlan_translation_out_cli = vlan_translation_out_cli ~ ' inner ' ~ vlan_translation.inner_vlan_to %} {% endif %} -{% elif vlan_translation.from is arista.avd.defined and vlan_translation.dot1q_tunnel is arista.avd.defined %} +{% elif vlan_translation.dot1q_tunnel is arista.avd.defined %} {% set vlan_translation_out_cli = 'switchport vlan translation out ' ~ vlan_translation.from %} {% if vlan_translation.dot1q_tunnel.all is arista.avd.defined(true) %} {% set vlan_translation_out_cli = vlan_translation_out_cli ~ ' dot1q-tunnel all' %}