summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAdam Smith <zero1three@gmail.com>2023-10-23 00:07:53 -0400
committerAdam Smith <zero1three@gmail.com>2023-10-23 00:07:53 -0400
commitfca8cce1c114f28cf2db8a0fe2ed7f8b37ea010c (patch)
tree30f531ca42f8e0e5172ed322252cb54eec47027f /src
parent9af3a9e64456174e053d855ebe6683b06d8313ee (diff)
downloadvyos-1x-fca8cce1c114f28cf2db8a0fe2ed7f8b37ea010c.tar.gz
vyos-1x-fca8cce1c114f28cf2db8a0fe2ed7f8b37ea010c.zip
T5677: lldp shows empty platform if descr not in lldpctl output
Diffstat (limited to 'src')
-rwxr-xr-xsrc/op_mode/lldp.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/op_mode/lldp.py b/src/op_mode/lldp.py
index c287b8fa6..58cfce443 100755
--- a/src/op_mode/lldp.py
+++ b/src/op_mode/lldp.py
@@ -114,7 +114,10 @@ def _get_formatted_output(raw_data):
# Remote software platform
platform = jmespath.search('chassis.[*][0][0].descr', values)
- tmp.append(platform[:37])
+ if platform:
+ tmp.append(platform[:37])
+ else:
+ tmp.append('')
# Remote interface
interface = jmespath.search('port.descr', values)