From a2b73df09d6eef07e8825789805b2e6d02b85656 Mon Sep 17 00:00:00 2001 From: Mikhail Sandakov Date: Tue, 29 Oct 2024 14:52:55 +0200 Subject: [PATCH] Add support for retrieving kernel modules on Debian-based systems --- pleskdistup/common/src/feedback.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/pleskdistup/common/src/feedback.py b/pleskdistup/common/src/feedback.py index b1cff2c..a73ae7f 100644 --- a/pleskdistup/common/src/feedback.py +++ b/pleskdistup/common/src/feedback.py @@ -153,8 +153,19 @@ def collect_plesk_version(out_file_path: str = "plesk_version.txt") -> typing.Li def collect_kernel_modules(out_file_path: str = "kernel_modules.txt") -> typing.List[str]: + possible_lsmod_paths = ["/usr/sbin/lsmod", "/sbin/lsmod"] + lsmod_utility = None + for lsmod_path in possible_lsmod_paths: + if os.path.exists(lsmod_path): + lsmod_utility = lsmod_path + break + + if lsmod_utility is None: + log.warn("lsmod utility not found, skipping kernel modules collection") + return [] + _collect_command_output( - ["/usr/sbin/lsmod"], + [lsmod_utility], out_file_path, "Getting kernel modules (called as {args}) failed: {ex}\n", )