summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2023-10-23 06:23:20 +0200
committerGitHub <noreply@github.com>2023-10-23 06:23:20 +0200
commit7b0d208632f3357c98612d12083851df90d67487 (patch)
tree30f531ca42f8e0e5172ed322252cb54eec47027f
parent9af3a9e64456174e053d855ebe6683b06d8313ee (diff)
parentfca8cce1c114f28cf2db8a0fe2ed7f8b37ea010c (diff)
downloadvyos-1x-7b0d208632f3357c98612d12083851df90d67487.tar.gz
vyos-1x-7b0d208632f3357c98612d12083851df90d67487.zip
Merge pull request #2396 from yzguy/yzguy/T5677
T5677: show lldp neighbors shows empty platform if descr not in lldpctl output
-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)