From 66046b6a9d149c99f0ce624be9b43ceeb1a0975c Mon Sep 17 00:00:00 2001 From: Sven Sager Date: Tue, 27 May 2025 14:54:44 +0200 Subject: [PATCH] feat(dbus): Update systemd unit state check to include 'activating' Previously, the check only considered 'active' as a valid ActiveState. This update ensures the system also accounts for units in the 'activating' state, improving compatibility with transitional states in systemd services. Signed-off-by: Sven Sager --- src/revpi_middleware/dbus_middleware1/systemd_helper.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/revpi_middleware/dbus_middleware1/systemd_helper.py b/src/revpi_middleware/dbus_middleware1/systemd_helper.py index bec26b7..e5359a0 100644 --- a/src/revpi_middleware/dbus_middleware1/systemd_helper.py +++ b/src/revpi_middleware/dbus_middleware1/systemd_helper.py @@ -100,7 +100,10 @@ def simple_systemd(action: ServiceActions, unit: str, unmask: bool = False) -> O log.warning(f"could not get systemd unit {unit}") return False - return properties.UnitFileState == "enabled" and properties.ActiveState == "active" + return properties.UnitFileState == "enabled" and properties.ActiveState in ( + "active", + "activating", + ) elif action is ServiceActions.AVAILABLE: try: