Compare commits
4 Commits
v0.0.4
...
acdb814007
| Author | SHA1 | Date | |
|---|---|---|---|
| acdb814007 | |||
| 8451b5401b | |||
| 0fe8be6515 | |||
| 5d376acf49 |
@@ -1,4 +1,4 @@
|
||||
<!-- /usr/share/dbus-1/system.d/com.revolutionpi.middleware1.conf -->
|
||||
<!-- /etc/dbus-1/system.d/revpi-middleware.conf -->
|
||||
<busconfig>
|
||||
<!-- Allow full access to root as the bus owner -->
|
||||
<policy user="root">
|
||||
@@ -12,7 +12,7 @@
|
||||
<allow send_destination="com.revolutionpi.middleware1"
|
||||
send_interface="org.freedesktop.DBus.Introspectable"/>
|
||||
<allow send_destination="com.revolutionpi.middleware1"
|
||||
send_interface="com.revolutionpi.middleware1.PiControl"/>
|
||||
send_interface="com.revolutionpi.middleware1.picontrol"/>
|
||||
</policy>
|
||||
|
||||
<!-- Standard-Policy -->
|
||||
|
||||
@@ -554,11 +554,7 @@ def configure_gui(action: ConfigActions):
|
||||
return gui_available
|
||||
|
||||
bus = SystemBus()
|
||||
systemd = bus.get(
|
||||
"org.freedesktop.systemd1",
|
||||
"/org/freedesktop/systemd1",
|
||||
)
|
||||
systemd_manager = systemd["org.freedesktop.systemd1.Manager"]
|
||||
systemd_manager = bus.get(".systemd1")
|
||||
|
||||
if action is ConfigActions.ENABLE:
|
||||
systemd_manager.SetDefaultTarget("graphical.target", True)
|
||||
@@ -658,11 +654,7 @@ def simple_systemd(action: ConfigActions, unit: str):
|
||||
ValueError: If the specified action is not supported.
|
||||
"""
|
||||
bus = SystemBus()
|
||||
systemd = bus.get(
|
||||
"org.freedesktop.systemd1",
|
||||
"/org/freedesktop/systemd1",
|
||||
)
|
||||
systemd_manager = systemd["org.freedesktop.systemd1.Manager"]
|
||||
systemd_manager = bus.get(".systemd1")
|
||||
|
||||
if action is ConfigActions.ENABLE:
|
||||
systemd_manager.UnmaskUnitFiles([unit], False)
|
||||
@@ -676,7 +668,7 @@ def simple_systemd(action: ConfigActions, unit: str):
|
||||
elif action is ConfigActions.STATUS:
|
||||
try:
|
||||
unit_path = systemd_manager.LoadUnit(unit)
|
||||
properties = bus.get("org.freedesktop.systemd1", unit_path)
|
||||
properties = bus.get(".systemd1", unit_path)
|
||||
except Exception:
|
||||
log.warning(f"could not get systemd unit {unit}")
|
||||
return False
|
||||
@@ -686,7 +678,7 @@ def simple_systemd(action: ConfigActions, unit: str):
|
||||
elif action is ConfigActions.AVAILABLE:
|
||||
try:
|
||||
unit_path = systemd_manager.LoadUnit(unit)
|
||||
properties = bus.get("org.freedesktop.systemd1", unit_path)
|
||||
properties = bus.get(".systemd1", unit_path)
|
||||
except Exception:
|
||||
log.warning(f"could not get systemd unit {unit}")
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user