diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-04-06 07:27:59 +0200 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2020-04-06 07:27:59 +0200 |
commit | e8b9eaddb5d8ddae8710a579676beade73fce1a8 (patch) | |
tree | 73749c07664e731410f774b629b828dbb0414d2c /src | |
parent | 10c06217a53b28a3b481c451e65da62e9b531a24 (diff) | |
download | vyos-1x-e8b9eaddb5d8ddae8710a579676beade73fce1a8.tar.gz vyos-1x-e8b9eaddb5d8ddae8710a579676beade73fce1a8.zip |
lldp: use vyos.version over handcrafted open().read().split() code
Diffstat (limited to 'src')
-rwxr-xr-x | src/conf_mode/lldp.py | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/conf_mode/lldp.py b/src/conf_mode/lldp.py index dd0b1ba0b..4e3dfc0b6 100755 --- a/src/conf_mode/lldp.py +++ b/src/conf_mode/lldp.py @@ -24,6 +24,7 @@ from sys import exit from vyos.config import Config from vyos.validate import is_addr_assigned,is_loopback_addr from vyos.defaults import directories as vyos_data_dir +from vyos.version import get_version_data from vyos import ConfigError config_file = "/etc/default/lldpd" @@ -67,7 +68,8 @@ def get_options(config): options['sonmp'] = config.exists('sonmp') # start with an unknown version information - options['description'] = 'unknown' + version_data = get_version_data() + options['description'] = version_data['version'] options['listen_on'] = [] return options @@ -211,10 +213,6 @@ def generate(lldp): fs_loader = FileSystemLoader(tmpl_path) env = Environment(loader=fs_loader) - with open('/opt/vyatta/etc/version', 'r') as f: - tmp = f.read() - lldp['options']['description'] = tmp.split()[1] - # generate listen on interfaces for intf in lldp['interface_list']: tmp = '' |