summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2021-11-28 10:44:12 +0100
committerChristian Poessinger <christian@poessinger.com>2021-11-28 10:44:12 +0100
commitb675c8b6187c4b77759e3f96c9c92dd382dabeae (patch)
treebdce32b58de17f1883647d720ead197b5a196fd5
parent1ec3f5b4573357314c008c6fa073b01a909c259e (diff)
downloadvyos-1x-b675c8b6187c4b77759e3f96c9c92dd382dabeae.tar.gz
vyos-1x-b675c8b6187c4b77759e3f96c9c92dd382dabeae.zip
op-mode: lldp: T3999: bugfix KeyError: 'capability'
-rwxr-xr-xsrc/op_mode/lldp_op.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/op_mode/lldp_op.py b/src/op_mode/lldp_op.py
index 731e71891..b9ebc991a 100755
--- a/src/op_mode/lldp_op.py
+++ b/src/op_mode/lldp_op.py
@@ -55,6 +55,9 @@ def parse_data(data, interface):
if interface is not None and local_if != interface:
continue
for chassis, c_value in values.get('chassis', {}).items():
+ # bail out early if no capabilities found
+ if 'capability' not in c_value:
+ continue
capabilities = c_value['capability']
if isinstance(capabilities, dict):
capabilities = [capabilities]