Skip to content

Commit a67a937

Browse files
jlevequelguohan
authored andcommitted
[lldp] For MGMT port, if port alias is available, use it for Port ID subtype; otherwise use port name (sonic-net#2445)
1 parent c82be49 commit a67a937

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

dockers/docker-lldp-sv2/lldpd.conf.j2

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
{% if MGMT_INTERFACE %}
2-
configure ports eth0 lldp portidsubtype local {{ MGMT_INTERFACE.keys()[0][0] }}
2+
{# If MGMT port alias is available, use it for port ID subtype, otherwise use port name #}
3+
{% set mgmt_port_name = MGMT_INTERFACE.keys()[0][0] %}
4+
{% if MGMT_PORT and MGMT_PORT[mgmt_port_name] and MGMT_PORT[mgmt_port_name].alias %}
5+
configure ports eth0 lldp portidsubtype local {{ MGMT_PORT[mgmt_port_name].alias }}
6+
{% else %}
7+
configure ports eth0 lldp portidsubtype local {{ mgmt_port_name }}
8+
{% endif %}
39
{% endif %}

0 commit comments

Comments
 (0)