diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests-2.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests-2.cfg index d088adac1c7..785454c18e7 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests-2.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests-2.cfg @@ -49,6 +49,11 @@ interface Port-Channel42 switchport mlag 42 ! +interface Port-Channel43 + no shutdown + switchport + mlag 43 +! interface Port-Channel101 description MLAG_PEER_network-ports-tests.1_Po101 no shutdown @@ -559,6 +564,14 @@ interface Ethernet12 switchport mode trunk phone switchport ! +interface Ethernet51 + no shutdown + channel-group 43 mode active +! +interface Ethernet52 + no shutdown + channel-group 43 mode active +! interface Vlan4094 description MLAG_PEER no shutdown diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests.1.cfg b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests.1.cfg index e48cf393a93..3207eb3114b 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests.1.cfg +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/configs/network-ports-tests.1.cfg @@ -538,6 +538,22 @@ interface Ethernet14 no shutdown switchport ! +interface Ethernet51 + shutdown + switchport +! +interface Ethernet52 + shutdown + switchport +! +interface Ethernet53 + shutdown + switchport +! +interface Ethernet54 + shutdown + switchport +! interface Vlan4094 description MLAG_PEER no shutdown diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests-2.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests-2.yml index 4b49983238a..6f2bced6a1a 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests-2.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests-2.yml @@ -69,6 +69,10 @@ port_channel_interfaces: type: switched shutdown: false mlag: 42 +- name: Port-Channel43 + type: switched + shutdown: false + mlag: 43 ethernet_interfaces: - name: Ethernet10/1 peer: network-ports-tests.1 @@ -710,6 +714,20 @@ ethernet_interfaces: channel_group: id: 42 mode: active +- name: Ethernet51 + peer_type: network_port + shutdown: false + type: port-channel-member + channel_group: + id: 43 + mode: active +- name: Ethernet52 + peer_type: network_port + shutdown: false + type: port-channel-member + channel_group: + id: 43 + mode: active mlag_configuration: domain_id: mlag local_interface: Vlan4094 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests.1.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests.1.yml index d24069a88f3..174dd455bd4 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests.1.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/intended/structured_configs/network-ports-tests.1.yml @@ -669,6 +669,22 @@ ethernet_interfaces: description: CONNECTED_ENDPOINT_OVERWRITING_NETWORK_PORT_Eth42 shutdown: false type: switched +- name: Ethernet51 + peer_type: network_port + shutdown: true + type: switched +- name: Ethernet52 + peer_type: network_port + shutdown: true + type: switched +- name: Ethernet53 + peer_type: network_port + shutdown: true + type: switched +- name: Ethernet54 + peer_type: network_port + shutdown: true + type: switched mlag_configuration: domain_id: mlag local_interface: Vlan4094 diff --git a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/NETWORK_PORTS_TESTS.yml b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/NETWORK_PORTS_TESTS.yml index ec46283be76..d4afdf86189 100644 --- a/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/NETWORK_PORTS_TESTS.yml +++ b/ansible_collections/arista/avd/molecule/eos_designs_unit_tests/inventory/group_vars/NETWORK_PORTS_TESTS.yml @@ -85,6 +85,20 @@ network_ports: - Ethernet12 description: Config overwriting base config + # Test no description + - switches: + - network-ports-tests.1 + switch_ports: + - Ethernet51-54 + enabled: false + - switches: + - network-ports-tests.2 + switch_ports: + - Ethernet51-52 + port_channel: + channel_id: 43 + mode: "active" + servers: - name: CONNECTED_ENDPOINT_OVERWRITING_NETWORK_PORT adapters: diff --git a/ansible_collections/arista/avd/roles/eos_designs/python_modules/connected_endpoints/ethernet_interfaces.py b/ansible_collections/arista/avd/roles/eos_designs/python_modules/connected_endpoints/ethernet_interfaces.py index 5705932afd7..d236ee1efde 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/python_modules/connected_endpoints/ethernet_interfaces.py +++ b/ansible_collections/arista/avd/roles/eos_designs/python_modules/connected_endpoints/ethernet_interfaces.py @@ -181,4 +181,4 @@ def _get_ethernet_interface_cfg(self, adapter: dict, node_index: int, connected_ if (flowcontrol_received := get(adapter, "flowcontrol.received")) is not None: ethernet_interface["flowcontrol"] = {"received": flowcontrol_received} - return strip_null_from_data(ethernet_interface) + return strip_null_from_data(ethernet_interface, strip_values_tuple=(None, "")) diff --git a/ansible_collections/arista/avd/roles/eos_designs/python_modules/connected_endpoints/port_channel_interfaces.py b/ansible_collections/arista/avd/roles/eos_designs/python_modules/connected_endpoints/port_channel_interfaces.py index 540376a3d8d..e654b33cde0 100644 --- a/ansible_collections/arista/avd/roles/eos_designs/python_modules/connected_endpoints/port_channel_interfaces.py +++ b/ansible_collections/arista/avd/roles/eos_designs/python_modules/connected_endpoints/port_channel_interfaces.py @@ -183,7 +183,7 @@ def _get_port_channel_interface_cfg(self, adapter: dict, port_channel_interface_ } ) - return strip_null_from_data(port_channel_interface) + return strip_null_from_data(port_channel_interface, strip_values_tuple=(None, "")) def _get_port_channel_subinterface_cfg(self, subinterface: dict, adapter: dict, port_channel_subinterface_name: str, channel_group_id: int) -> dict: """ @@ -215,4 +215,4 @@ def _get_port_channel_subinterface_cfg(self, subinterface: dict, adapter: dict, "route_target": generate_route_target(short_esi), } - return strip_null_from_data(port_channel_interface) + return strip_null_from_data(port_channel_interface, strip_values_tuple=(None, ""))