summaryrefslogtreecommitdiff
path: root/src/conf_mode
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2019-12-22 20:11:35 +0100
committerChristian Poessinger <christian@poessinger.com>2019-12-22 20:11:35 +0100
commitf1eae1ba095319aca3e8e2ccbcd81758d7e1a638 (patch)
tree1169b8e972aed489ca672b69c237491e5e56c0f5 /src/conf_mode
parent718d115c994ea67b30589f1e50de1463fd254e79 (diff)
downloadvyos-1x-f1eae1ba095319aca3e8e2ccbcd81758d7e1a638.tar.gz
vyos-1x-f1eae1ba095319aca3e8e2ccbcd81758d7e1a638.zip
lldp: T393: support parsing MED values
Diffstat (limited to 'src/conf_mode')
-rwxr-xr-xsrc/conf_mode/lldp.py23
1 files changed, 9 insertions, 14 deletions
diff --git a/src/conf_mode/lldp.py b/src/conf_mode/lldp.py
index 1b7676274..15c0f7812 100755
--- a/src/conf_mode/lldp.py
+++ b/src/conf_mode/lldp.py
@@ -96,8 +96,6 @@ def get_interface_list(config):
def get_location_intf(config, name):
path = 'service lldp interface {0}'.format(name)
config.set_level(path)
- if config.exists('location'):
- return 0
config.set_level('{} location'.format(path))
civic_based = {}
@@ -106,19 +104,16 @@ def get_location_intf(config, name):
if config.exists('civic-based'):
config.set_level('{} location civic-based'.format(path))
- cc = config.return_value('country-code')
- civic_based['country_code'] = cc
+ civic_based['country_code'] = config.return_value('country-code')
civic_based['ca_type'] = []
- ca_types_names = config.list_nodes('ca-type')
- if ca_types_names:
- for ca_types_name in ca_types_names:
- config.set_level('{0} location civic-based ca-type {1}'.format(path, ca_types_name))
- ca_val = config.return_value('ca-value')
- ca_type = {
- 'name': ca_types_name,
- 'ca_val': ca_val
- }
- civic_based['ca_type'].append(ca_type)
+ for ca_types_name in config.list_nodes('ca-type'):
+ config.set_level('{} location civic-based ca-type {}'.format(path, ca_types_name))
+ ca_val = config.return_value('ca-value')
+ ca_type = {
+ 'name': ca_types_name,
+ 'ca_val': ca_val
+ }
+ civic_based['ca_type'].append(ca_type)
elif config.exists('elin'):
elin = config.return_value('elin')