Skip to content

Commit

Permalink
Storage management: exclude CD players from disks API
Browse files Browse the repository at this point in the history
  • Loading branch information
christophehenry committed Feb 21, 2025
1 parent 9eee442 commit 7968937
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/utils/udisks2_interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
from typing import Any, Dict, List, Tuple, Optional

from sdbus import (
DbusDeprecatedFlag,
DbusInterfaceCommon,
DbusPropertyEmitsChangeFlag,
DbusUnprivilegedFlag,
Expand Down Expand Up @@ -39,7 +38,10 @@ def get_disks(self) -> dict[str, DiskResult]:
on_unknown_interface="none",
on_unknown_member="ignore",
).items():
if object_path.startswith(UDISKS2_DRIVE_PATH) and issubclass(iface, Disk):
if (
object_path.startswith(UDISKS2_DRIVE_PATH) # This is a drive
and not props["optical"] # This is not a CD player
):
value = DiskResult(object_path, iface, props)
result[value.name] = value

Expand Down Expand Up @@ -126,13 +128,6 @@ def mdraid_create(
) -> str:
raise NotImplementedError

@dbus_method(
input_signature="b",
flags=DbusDeprecatedFlag | DbusUnprivilegedFlag,
)
def enable_modules(self, enable: bool) -> None:
raise NotImplementedError

@dbus_method(
input_signature="sb",
flags=DbusUnprivilegedFlag,
Expand Down

0 comments on commit 7968937

Please sign in to comment.