Fixing lldp issue displaying mac-addr instead of ports (#1515)
Current lldp.conf.j2 template demands the presence of MGMT_INTERFACE attribute in configDB, and by extension, also in config_db.json file. However, MGMT_INTERFACE configuration attribute is optional, so lldp shouldn't bail out if this one isn't provided in configuration. For this reason, no lldp.conf file is ever created in lldp's container, and lldpd defaults to advertise the mac-address of the connected interface, instead of the interface name. The fix is to simply relax this jinja2 statement to verify if MGMT_INTERFACE attribute is present.
This commit is contained in:
parent
06a823d3fb
commit
957e6c0b6d
@ -1,4 +1,6 @@
|
|||||||
|
{% if MGMT_INTERFACE %}
|
||||||
configure ports eth0 lldp portidsubtype local {{ MGMT_INTERFACE.keys()[0][0] }}
|
configure ports eth0 lldp portidsubtype local {{ MGMT_INTERFACE.keys()[0][0] }}
|
||||||
|
{% endif %}
|
||||||
{% for local_port in DEVICE_NEIGHBOR %}
|
{% for local_port in DEVICE_NEIGHBOR %}
|
||||||
configure ports {{ local_port }} lldp portidsubtype local {{ PORT[local_port]['alias'] }} description {{ DEVICE_NEIGHBOR[local_port]['name'] }}:{{ DEVICE_NEIGHBOR[local_port]['port'] }}
|
configure ports {{ local_port }} lldp portidsubtype local {{ PORT[local_port]['alias'] }} description {{ DEVICE_NEIGHBOR[local_port]['name'] }}:{{ DEVICE_NEIGHBOR[local_port]['port'] }}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
Loading…
Reference in New Issue
Block a user