diff options
author | Daniil Baturin <daniil@baturin.org> | 2025-04-28 19:17:52 +0100 |
---|---|---|
committer | Daniil Baturin <daniil@baturin.org> | 2025-04-28 19:19:55 +0100 |
commit | 30a39bf0a95b1d36a5c082e92cb6f12d73b268fd (patch) | |
tree | e29bccbf99544406ab649dd83e294c17389248f4 /src/op_mode/tech_support.py | |
parent | 5490006e7ad81908540c8bf0fef80798f95fe77d (diff) | |
download | vyos-1x-30a39bf0a95b1d36a5c082e92cb6f12d73b268fd.tar.gz vyos-1x-30a39bf0a95b1d36a5c082e92cb6f12d73b268fd.zip |
tech-support: T7410: handle possible errors when executing lsusb
because it exits with a non-zero code on machines
without USB controllers
Diffstat (limited to 'src/op_mode/tech_support.py')
-rw-r--r-- | src/op_mode/tech_support.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/op_mode/tech_support.py b/src/op_mode/tech_support.py index 24ac0af1b..c4496dfa3 100644 --- a/src/op_mode/tech_support.py +++ b/src/op_mode/tech_support.py @@ -1,6 +1,6 @@ #!/usr/bin/env python3 # -# Copyright (C) 2024 VyOS maintainers and contributors +# Copyright (C) 2025 VyOS maintainers and contributors # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License version 2 or later as @@ -20,6 +20,7 @@ import json import vyos.opmode from vyos.utils.process import cmd +from vyos.base import Warning def _get_version_data(): from vyos.version import get_version_data @@ -51,7 +52,12 @@ def _get_storage(): def _get_devices(): devices = {} devices["pci"] = cmd("lspci") - devices["usb"] = cmd("lsusb") + + try: + devices["usb"] = cmd("lsusb") + except OSError: + Warning("Could not retrieve information about USB devices") + devices["usb"] = {} return devices |