summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniil Baturin <daniil@vyos.io>2023-10-23 16:11:34 +0100
committerGitHub <noreply@github.com>2023-10-23 16:11:34 +0100
commitabf3bea0af3ec640057add5dfa6da1b59b85a651 (patch)
treea1b93bb6c168fad5ff985670b06cbb9249a994b0 /src
parent2007a883125c7c6e1a0a1b06b0e0d32f9b1dc693 (diff)
parente7c027e53e7acae3c630263589edf3104bba39bc (diff)
downloadvyos-1x-abf3bea0af3ec640057add5dfa6da1b59b85a651.tar.gz
vyos-1x-abf3bea0af3ec640057add5dfa6da1b59b85a651.zip
Merge pull request #2398 from vyos/mergify/bp/sagitta/pr-2396
T5677: show lldp neighbors shows empty platform if descr not in lldpctl output (backport #2396)
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)