From e4b56e2988d3c5599702e858bd2b9ea8ed0ec9a1 Mon Sep 17 00:00:00 2001 From: Christian Poessinger Date: Sun, 22 Dec 2019 21:36:37 +0100 Subject: lldp: T393: support IPv6 management address --- src/conf_mode/lldp.py | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/conf_mode/lldp.py b/src/conf_mode/lldp.py index be7880c55..9fd32d83f 100755 --- a/src/conf_mode/lldp.py +++ b/src/conf_mode/lldp.py @@ -27,7 +27,7 @@ from vyos import ConfigError config_file = "/etc/default/lldpd" lldp_tmpl = """ ### Autogenerated by lldp.py ### -DAEMON_ARGS="-M 4{% if options.snmp %} -x{% endif %}{% if options.addr %} -m {{ options.addr }}{% endif %}{% if options.cdp %} -c{% endif %}{% if options.edp %} -e{% endif %}{% if options.fdp %} -f{% endif %}{% if options.sonmp %} -s{% endif %}" +DAEMON_ARGS="-M 4{% if options.snmp %} -x{% endif %}{% if options.cdp %} -c{% endif %}{% if options.edp %} -e{% endif %}{% if options.fdp %} -f{% endif %}{% if options.sonmp %} -s{% endif %}" """ @@ -37,17 +37,17 @@ vyos_tmpl = """ configure system platform VyOS configure system description "VyOS {{ options.description }}" -{% if listen_on %} +{%- if listen_on -%} configure system interface pattern "{{ options.listen_on | join(",") }}" -{% endif %} - -{% for loc in location %} -{%- if loc.elin %} +{%- endif %} +{% if options.addr -%} +configure system ip management pattern "{{ options.addr }}" +{%- endif %} +{%- for loc in location -%} +{%- if loc.elin -%} configure ports {{ loc.name }} med location elin "{{ loc.elin }}" {%- endif %} {% endfor %} - - """ default_config_data = { @@ -289,7 +289,6 @@ def apply(lldp): os.system('sudo systemctl stop lldpd.service') os.unlink(config_file) - if __name__ == '__main__': try: c = get_config() -- cgit v1.2.3