diff options
author | Christian Poessinger <christian@poessinger.com> | 2019-12-22 21:36:37 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2019-12-22 21:36:37 +0100 |
commit | e4b56e2988d3c5599702e858bd2b9ea8ed0ec9a1 (patch) | |
tree | 62b993f0df691dbd52a5aa1737da8d6d7bb24e94 /src/conf_mode/lldp.py | |
parent | 2f0119a2aa6cf6375657e7ab4b16f5b750b45f68 (diff) | |
download | vyos-1x-e4b56e2988d3c5599702e858bd2b9ea8ed0ec9a1.tar.gz vyos-1x-e4b56e2988d3c5599702e858bd2b9ea8ed0ec9a1.zip |
lldp: T393: support IPv6 management address
Diffstat (limited to 'src/conf_mode/lldp.py')
-rwxr-xr-x | src/conf_mode/lldp.py | 17 |
1 files changed, 8 insertions, 9 deletions
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() |