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 2d33f18
Showing 1 changed file with 13 additions and 2 deletions.
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

0 comments on commit 2d33f18

Please sign in to comment.