Skip to content

Commit

Permalink
[lldp] For MGMT port, if port alias is available, use it for Port ID …
Browse files Browse the repository at this point in the history
…subtype; otherwise use port name (#2445)
  • Loading branch information
jleveque authored and lguohan committed Jan 25, 2019
1 parent c82be49 commit a67a937
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dockers/docker-lldp-sv2/lldpd.conf.j2
Original file line number Diff line number Diff line change
@@ -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 %}

0 comments on commit a67a937

Please sign in to comment.