From bedc0044fb4fdfb597162b9c957aa9e09d1d9398 Mon Sep 17 00:00:00 2001 From: Joe LeVeque Date: Mon, 14 Jan 2019 21:06:09 +0000 Subject: [PATCH] [lldp] For MGMT port, if port alias is available, use it for Port ID subtype; otherwise use port name --- dockers/docker-lldp-sv2/lldpd.conf.j2 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/dockers/docker-lldp-sv2/lldpd.conf.j2 b/dockers/docker-lldp-sv2/lldpd.conf.j2 index 94a04596699f..fd8a4d4c5458 100644 --- a/dockers/docker-lldp-sv2/lldpd.conf.j2 +++ b/dockers/docker-lldp-sv2/lldpd.conf.j2 @@ -1,3 +1,9 @@ {% if MGMT_INTERFACE %} -configure ports eth0 lldp portidsubtype local {{ MGMT_INTERFACE.keys()[0][0] }} +{# If MGMT port alias is available, use it for port ID subtype, otherwise use port name #} +{% set mgmt_port_name = MGMT_INTERFACE.keys()[0][0] %} +{% if MGMT_PORT and MGMT_PORT[mgmt_port_name] and MGMT_PORT[mgmt_port_name].alias %} +configure ports eth0 lldp portidsubtype local {{ MGMT_PORT[mgmt_port_name].alias }} +{% else %} +configure ports eth0 lldp portidsubtype local {{ mgmt_port_name }} +{% endif %} {% endif %}