Skip to content

Commit

Permalink
Add support for retrieving kernel modules on Debian-based systems
Browse files Browse the repository at this point in the history
  • Loading branch information
Mikhail Sandakov committed Oct 29, 2024
1 parent b000547 commit a2b73df
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion pleskdistup/common/src/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
)
Expand Down

0 comments on commit a2b73df

Please sign in to comment.