From 08ca3c1af29c2703d6144f109cffe3394793dd4d Mon Sep 17 00:00:00 2001 From: vdahiya12 <67608553+vdahiya12@users.noreply.github.com> Date: Thu, 24 Oct 2024 17:43:00 -0700 Subject: [PATCH] [ansible][minigraph] Fix minigraph template for devices which have autoneg enabled but the topo file does not contain autoneg interfaces (#15134) This pull request updates the Jinja2 template minigraph_link_meta.j2 by modifying the generation of the section. Key Changes: * The condition has been changed from simply checking if msft_an_enabled is defined to also checking if vm_topo_config.get('autoneg_interfaces') is not None. * This ensures that the section is only included if both msft_an_enabled is defined and the autoneg_interfaces attribute in vm_topo_config exists and is not None. This ensures if some testbeds/devices have msft_an_enabled they do not end up treated as autoneg devices unless the topo file contains the AN interface list Signed-off-by: Vaibhav Dahiya --- ansible/templates/minigraph_link_meta.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ansible/templates/minigraph_link_meta.j2 b/ansible/templates/minigraph_link_meta.j2 index b6420c01995..428965c16d4 100644 --- a/ansible/templates/minigraph_link_meta.j2 +++ b/ansible/templates/minigraph_link_meta.j2 @@ -53,7 +53,7 @@ {% endif %} -{% if msft_an_enabled is defined %} +{% if msft_an_enabled is defined and vm_topo_config.get('autoneg_interfaces') is not none %} {% for if_index in vm_topo_config['autoneg_interfaces']['intfs'] %}