Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for retrieving kernel modules on Debian-based systems #92

Merged
merged 1 commit into from
Oct 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions pleskdistup/common/src/feedback.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import typing
import zipfile

from . import dist, plesk
from . import dist, log, plesk


class Feedback():
Expand Down 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: typing.List[str] = ["/usr/sbin/lsmod", "/sbin/lsmod"]
lsmod_utility: typing.Optional[str] = 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
Loading