From 87fc84c65c5ac035f07eeae68b034b67e6565656 Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Mon, 8 Sep 2025 11:29:44 +0200 Subject: [PATCH] Avoid setup failure on missing timedatectl (#6169) When timedatectl is not available (e.g. in minimal devcontainers), the code currently fails to setup due to missing timedate service on D-Bus. This change makes the code more robust by checking only checking for the presence of the service if we actually going to use it. --- supervisor/host/control.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/supervisor/host/control.py b/supervisor/host/control.py index 476130124..634f0f8c8 100644 --- a/supervisor/host/control.py +++ b/supervisor/host/control.py @@ -85,14 +85,13 @@ class SystemControl(CoreSysAttributes): async def set_timezone(self, timezone: str) -> None: """Set timezone on host.""" - self._check_dbus(HostFeature.TIMEDATE) - # /etc/localtime is not writable on OS older than 16.2 if ( self.coresys.os.available and self.coresys.os.version is not None and self.sys_os.version >= AwesomeVersion("16.2.dev20250814") ): + self._check_dbus(HostFeature.TIMEDATE) _LOGGER.info("Setting host timezone: %s", timezone) await self.sys_dbus.timedate.set_timezone(timezone) await self.sys_dbus.timedate.update()