From 7764decc374955883f4608d93878e435ed0bc90c Mon Sep 17 00:00:00 2001 From: Stefan Agner Date: Wed, 17 Nov 2021 15:41:35 +0100 Subject: [PATCH] Fix grammer of some error messages (#3310) --- supervisor/addons/__init__.py | 4 ++-- supervisor/addons/options.py | 2 +- supervisor/docker/__init__.py | 2 +- supervisor/homeassistant/secrets.py | 2 +- supervisor/services/modules/mqtt.py | 4 +++- supervisor/utils/common.py | 2 +- 6 files changed, 9 insertions(+), 7 deletions(-) diff --git a/supervisor/addons/__init__.py b/supervisor/addons/__init__.py index 29a5b3a24..cacdccc78 100644 --- a/supervisor/addons/__init__.py +++ b/supervisor/addons/__init__.py @@ -158,11 +158,11 @@ class AddonManager(CoreSysAttributes): store = self.store.get(slug) if not store: - raise AddonsError(f"Add-on {slug} not exists", _LOGGER.error) + raise AddonsError(f"Add-on {slug} does not exist", _LOGGER.error) if not store.available: raise AddonsNotSupportedError( - f"Add-on {slug} not supported on that platform", _LOGGER.error + f"Add-on {slug} not supported on this platform", _LOGGER.error ) self.data.install(store) diff --git a/supervisor/addons/options.py b/supervisor/addons/options.py index aa6b7bda1..b9daded7e 100644 --- a/supervisor/addons/options.py +++ b/supervisor/addons/options.py @@ -167,7 +167,7 @@ class AddonOptions(CoreSysAttributes): device = self.sys_hardware.get_by_path(Path(value)) except HardwareNotFound: raise vol.Invalid( - f"Device '{value}' does not exists! in {self._name} ({self._slug})" + f"Device '{value}' does not exist in {self._name} ({self._slug})" ) from None # Have filter diff --git a/supervisor/docker/__init__.py b/supervisor/docker/__init__.py index 8ca9251f5..060d0fd3c 100644 --- a/supervisor/docker/__init__.py +++ b/supervisor/docker/__init__.py @@ -155,7 +155,7 @@ class DockerAPI: ) except docker_errors.NotFound as err: raise DockerNotFound( - f"Image {image} not exists for {name}", _LOGGER.error + f"Image {image}:{tag} does not exist for {name}", _LOGGER.error ) from err except docker_errors.DockerException as err: raise DockerAPIError( diff --git a/supervisor/homeassistant/secrets.py b/supervisor/homeassistant/secrets.py index b92ecbbb1..09f91b7ad 100644 --- a/supervisor/homeassistant/secrets.py +++ b/supervisor/homeassistant/secrets.py @@ -45,7 +45,7 @@ class HomeAssistantSecrets(CoreSysAttributes): async def _read_secrets(self): """Read secrets.yaml into memory.""" if not self.path_secrets.exists(): - _LOGGER.debug("Home Assistant secrets not exists") + _LOGGER.debug("Home Assistant secrets.yaml does not exist") return # Read secrets diff --git a/supervisor/services/modules/mqtt.py b/supervisor/services/modules/mqtt.py index d4177d0cb..00f5a3829 100644 --- a/supervisor/services/modules/mqtt.py +++ b/supervisor/services/modules/mqtt.py @@ -82,7 +82,9 @@ class MQTTService(ServiceInterface): def del_service_data(self, addon: Addon) -> None: """Remove the data from service object.""" if not self.enabled: - raise ServicesError("Can't remove not exists services", _LOGGER.warning) + raise ServicesError( + "Can't remove nonexistent service data", _LOGGER.warning + ) self._data.clear() self.save() diff --git a/supervisor/utils/common.py b/supervisor/utils/common.py index 595a0ee3c..cf0b3168f 100644 --- a/supervisor/utils/common.py +++ b/supervisor/utils/common.py @@ -20,7 +20,7 @@ def find_one_filetype(path: Path, filename: str, filetypes: list[str]) -> Path: for file in path.glob(f"**/{filename}.*"): if file.suffix in filetypes: return file - raise ConfigurationFileError(f"{path!s}/{filename}.({filetypes}) not exists!") + raise ConfigurationFileError(f"{path!s}/{filename}.({filetypes}) does not exist!") def read_json_or_yaml_file(path: Path) -> dict: