Skip to content

Commit 277c39c

Browse files
authored
update autoneg setting to support 'off' when deploy-mg (#20030)
Summary: Current 'autoneg' column in links.csv only support 'on'. If it's 'off' or other settings, it will default to platform.json behavior. This PR add the support for 'off' settings. For DUT which want to use the default behavior, it can leave that column empty, or use any other value, e.g. 'none' Note: There will be a behavior change if user is using off in links.csv already for their DUT. old behavior: the autoneg settings will be derived from platform.json, which chould be on or off or not defined. new behavior: will be off always. If users is using off already, they need to update their links.csv to leave autoneg field as empty if they want to use the default settings in platform.json. What is the motivation for this PR? update autoneg setting to support 'off' How did you do it? Check autoneg value for both on and off in minigraph
1 parent c08ca93 commit 277c39c

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

ansible/templates/minigraph_link_meta.j2

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
{%- endif -%}
66

77
{%- if device_conn is defined and inventory_hostname in device_conn and
8-
device_conn[inventory_hostname].values() | selectattr('autoneg', 'defined') | selectattr('autoneg', 'equalto', 'on') | list | length > 0 -%}
8+
device_conn[inventory_hostname].values() | selectattr('autoneg', 'defined') | selectattr('autoneg', 'in', ['on', 'off']) | list | length > 0 -%}
99
{% set ns.link_metadata_defined = True %}
1010
{%- endif -%}
1111
{% if ns.link_metadata_defined %}
@@ -61,13 +61,17 @@
6161
{% if device_conn is defined and inventory_hostname in device_conn %}
6262
{% for iface_name in device_conn[inventory_hostname].keys() %}
6363
{% if iface_name in device_conn[inventory_hostname] and 'autoneg' in device_conn[inventory_hostname][iface_name] %}
64-
{% if 'on' in device_conn[inventory_hostname][iface_name]['autoneg'] %}
64+
{% if device_conn[inventory_hostname][iface_name]['autoneg'] in ['on', 'off'] %}
6565
<a:LinkMetadata>
6666
<a:Name i:nil="true"/>
6767
<a:Properties>
6868
<a:DeviceProperty>
6969
<a:Name>AutoNegotiation</a:Name>
70+
{% if device_conn[inventory_hostname][iface_name]['autoneg'] in ['on'] %}
7071
<a:Value>True</a:Value>
72+
{% else %}
73+
<a:Value>False</a:Value>
74+
{% endif %}
7175
</a:DeviceProperty>
7276
{% if msft_an_enabled is defined %}
7377
<a:DeviceProperty>

0 commit comments

Comments
 (0)