Skip to content

Commit

Permalink
Use lists for calls to start_transient_unit
Browse files Browse the repository at this point in the history
dbus-fast wants a list here and not a tuple

see home-assistant#4681
  • Loading branch information
bdraco committed Nov 10, 2023
1 parent 7887018 commit 7e79f61
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ PyYAML==6.0.1
securetar==2023.3.0
sentry-sdk==1.34.0
voluptuous==0.13.1
dbus-fast==2.12.0
dbus-fast==2.13.1
typing_extensions==4.8.0
2 changes: 1 addition & 1 deletion supervisor/dbus/systemd.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ async def list_units(

@dbus_connected
async def start_transient_unit(
self, unit: str, mode: StartUnitMode, properties: list[tuple[str, Variant]]
self, unit: str, mode: StartUnitMode, properties: list[list[str, Variant]]
) -> str:
"""Start a transient unit which is released when stopped or on reboot. Returns object path of job."""
return await self.dbus.Manager.call_start_transient_unit(
Expand Down
8 changes: 4 additions & 4 deletions supervisor/mounts/mount.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,20 +235,20 @@ async def mount(self) -> None:

try:
options = (
[(DBUS_ATTR_OPTIONS, Variant("s", ",".join(self.options)))]
[[DBUS_ATTR_OPTIONS, Variant("s", ",".join(self.options))]]
if self.options
else []
)
if self.type != MountType.BIND:
options += [(DBUS_ATTR_TYPE, Variant("s", self.type))]
options += [[DBUS_ATTR_TYPE, Variant("s", self.type)]]

await self.sys_dbus.systemd.start_transient_unit(
self.unit_name,
StartUnitMode.FAIL,
options
+ [
(DBUS_ATTR_DESCRIPTION, Variant("s", self.description)),
(DBUS_ATTR_WHAT, Variant("s", self.what)),
[DBUS_ATTR_DESCRIPTION, Variant("s", self.description)],
[DBUS_ATTR_WHAT, Variant("s", self.what)],
],
)
except DBusError as err:
Expand Down

0 comments on commit 7e79f61

Please sign in to comment.