mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-20 15:46:29 +00:00
Use new format for logging exceptions - host/services.py (#3213)
Co-authored-by: Joakim Sørensen <hi@ludeeus.dev>
This commit is contained in:
parent
79d541185f
commit
394d66290d
@ -26,12 +26,12 @@ class ServiceManager(CoreSysAttributes):
|
|||||||
def _check_dbus(self, unit=None):
|
def _check_dbus(self, unit=None):
|
||||||
"""Check available dbus connection."""
|
"""Check available dbus connection."""
|
||||||
if not self.sys_dbus.systemd.is_connected:
|
if not self.sys_dbus.systemd.is_connected:
|
||||||
_LOGGER.error("No systemd D-Bus connection available")
|
raise HostNotSupportedError(
|
||||||
raise HostNotSupportedError()
|
"No systemd D-Bus connection available", _LOGGER.error
|
||||||
|
)
|
||||||
|
|
||||||
if unit and not self.exists(unit):
|
if unit and not self.exists(unit):
|
||||||
_LOGGER.error("Unit '%s' not found", unit)
|
raise HostServiceError(f"Unit '{unit}' not found", _LOGGER.error)
|
||||||
raise HostServiceError()
|
|
||||||
|
|
||||||
def start(self, unit):
|
def start(self, unit):
|
||||||
"""Start a service on host."""
|
"""Start a service on host."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user