mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-24 09:36:31 +00:00
Use new format for logging exceptions - services/modules/mysql.py (#3180)
This commit is contained in:
parent
279d6ccd79
commit
d33beb06cd
@ -62,11 +62,10 @@ class MySQLService(ServiceInterface):
|
||||
def set_service_data(self, addon: Addon, data: dict[str, Any]) -> None:
|
||||
"""Write the data into service object."""
|
||||
if self.enabled:
|
||||
_LOGGER.error(
|
||||
"There is already a MySQL service in use from %s",
|
||||
self._data[ATTR_ADDON],
|
||||
raise ServicesError(
|
||||
f"There is already a MySQL service in use from {self._data[ATTR_ADDON]}",
|
||||
_LOGGER.error,
|
||||
)
|
||||
raise ServicesError()
|
||||
|
||||
self._data.update(data)
|
||||
self._data[ATTR_ADDON] = addon.slug
|
||||
@ -77,8 +76,7 @@ class MySQLService(ServiceInterface):
|
||||
def del_service_data(self, addon: Addon) -> None:
|
||||
"""Remove the data from service object."""
|
||||
if not self.enabled:
|
||||
_LOGGER.warning("Can't remove not exists services")
|
||||
raise ServicesError()
|
||||
raise ServicesError("Can't remove not exists services", _LOGGER.warning)
|
||||
|
||||
self._data.clear()
|
||||
self.save()
|
||||
|
Loading…
x
Reference in New Issue
Block a user