summaryrefslogtreecommitdiff
path: root/src/op_mode/lldp.py
diff options
context:
space:
mode:
authorAdam Smith <zero1three@gmail.com>2023-10-23 00:07:53 -0400
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2023-10-23 04:24:27 +0000
commite7c027e53e7acae3c630263589edf3104bba39bc (patch)
treea1b93bb6c168fad5ff985670b06cbb9249a994b0 /src/op_mode/lldp.py
parent2007a883125c7c6e1a0a1b06b0e0d32f9b1dc693 (diff)
downloadvyos-1x-e7c027e53e7acae3c630263589edf3104bba39bc.tar.gz
vyos-1x-e7c027e53e7acae3c630263589edf3104bba39bc.zip
T5677: lldp shows empty platform if descr not in lldpctl output
(cherry picked from commit fca8cce1c114f28cf2db8a0fe2ed7f8b37ea010c)
Diffstat (limited to 'src/op_mode/lldp.py')
-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)