From ed7edd9fe0791cdc4d90e7444277613922e1c7a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= Date: Wed, 20 Dec 2023 18:34:42 +0100 Subject: [PATCH] Adjust "retry in ..." log messages to avoid confusion (#4783) As shown in home-assistant/operating-system#3007, error messages printed to logs when container installation fails can cause some confusion, because they are sometimes printed to the log on the landing page. Adjust all wordings of "retry in" to "retrying in" to make it obvious this happens automatically. --- supervisor/homeassistant/core.py | 6 +++--- supervisor/plugins/cli.py | 2 +- supervisor/plugins/dns.py | 2 +- supervisor/plugins/multicast.py | 2 +- supervisor/plugins/observer.py | 2 +- tests/homeassistant/test_core.py | 8 ++++---- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/supervisor/homeassistant/core.py b/supervisor/homeassistant/core.py index e6a996545..e910fb2d0 100644 --- a/supervisor/homeassistant/core.py +++ b/supervisor/homeassistant/core.py @@ -129,7 +129,7 @@ class HomeAssistantCore(JobGroup): while True: if not self.sys_updater.image_homeassistant: _LOGGER.warning( - "Found no information about Home Assistant. Retry in 30sec" + "Found no information about Home Assistant. Retrying in 30sec" ) await asyncio.sleep(30) await self.sys_updater.reload() @@ -145,7 +145,7 @@ class HomeAssistantCore(JobGroup): except Exception as err: # pylint: disable=broad-except capture_exception(err) - _LOGGER.warning("Fails install landingpage, retry after 30sec") + _LOGGER.warning("Failed to install landingpage, retrying after 30sec") await asyncio.sleep(30) self.sys_homeassistant.version = LANDINGPAGE @@ -177,7 +177,7 @@ class HomeAssistantCore(JobGroup): except Exception as err: # pylint: disable=broad-except capture_exception(err) - _LOGGER.warning("Error on Home Assistant installation. Retry in 30sec") + _LOGGER.warning("Error on Home Assistant installation. Retrying in 30sec") await asyncio.sleep(30) _LOGGER.info("Home Assistant docker now installed") diff --git a/supervisor/plugins/cli.py b/supervisor/plugins/cli.py index 46c54877f..893819a0f 100644 --- a/supervisor/plugins/cli.py +++ b/supervisor/plugins/cli.py @@ -66,7 +66,7 @@ class PluginCli(PluginBase): image=self.sys_updater.image_cli, ) break - _LOGGER.warning("Error on install cli plugin. Retry in 30sec") + _LOGGER.warning("Error on install cli plugin. Retrying in 30sec") await asyncio.sleep(30) _LOGGER.info("CLI plugin is now installed") diff --git a/supervisor/plugins/dns.py b/supervisor/plugins/dns.py index a9cdaa288..b6c320e7d 100644 --- a/supervisor/plugins/dns.py +++ b/supervisor/plugins/dns.py @@ -175,7 +175,7 @@ class PluginDns(PluginBase): self.latest_version, image=self.sys_updater.image_dns ) break - _LOGGER.warning("Error on install CoreDNS plugin. Retry in 30sec") + _LOGGER.warning("Error on install CoreDNS plugin. Retrying in 30sec") await asyncio.sleep(30) _LOGGER.info("CoreDNS plugin now installed") diff --git a/supervisor/plugins/multicast.py b/supervisor/plugins/multicast.py index 7cd3b79d4..d69103d86 100644 --- a/supervisor/plugins/multicast.py +++ b/supervisor/plugins/multicast.py @@ -62,7 +62,7 @@ class PluginMulticast(PluginBase): self.latest_version, image=self.sys_updater.image_multicast ) break - _LOGGER.warning("Error on install Multicast plugin. Retry in 30sec") + _LOGGER.warning("Error on install Multicast plugin. Retrying in 30sec") await asyncio.sleep(30) _LOGGER.info("Multicast plugin is now installed") diff --git a/supervisor/plugins/observer.py b/supervisor/plugins/observer.py index b78d011fe..5d2fe86ca 100644 --- a/supervisor/plugins/observer.py +++ b/supervisor/plugins/observer.py @@ -70,7 +70,7 @@ class PluginObserver(PluginBase): self.latest_version, image=self.sys_updater.image_observer ) break - _LOGGER.warning("Error on install observer plugin. Retry in 30sec") + _LOGGER.warning("Error on install observer plugin. Retrying in 30sec") await asyncio.sleep(30) _LOGGER.info("observer plugin now installed") diff --git a/tests/homeassistant/test_core.py b/tests/homeassistant/test_core.py index 7adf5a899..acf167b8a 100644 --- a/tests/homeassistant/test_core.py +++ b/tests/homeassistant/test_core.py @@ -65,7 +65,7 @@ async def test_install_landingpage_docker_error( await coresys.homeassistant.core.install_landingpage() sleep.assert_awaited_once_with(30) - assert "Fails install landingpage, retry after 30sec" in caplog.text + assert "Failed to install landingpage, retrying after 30sec" in caplog.text capture_exception.assert_not_called() @@ -87,7 +87,7 @@ async def test_install_landingpage_other_error( await coresys.homeassistant.core.install_landingpage() sleep.assert_awaited_once_with(30) - assert "Fails install landingpage, retry after 30sec" in caplog.text + assert "Failed to install landingpage, retrying after 30sec" in caplog.text capture_exception.assert_called_once_with(err) @@ -113,7 +113,7 @@ async def test_install_docker_error( await coresys.homeassistant.core.install() sleep.assert_awaited_once_with(30) - assert "Error on Home Assistant installation. Retry in 30sec" in caplog.text + assert "Error on Home Assistant installation. Retrying in 30sec" in caplog.text capture_exception.assert_not_called() @@ -137,7 +137,7 @@ async def test_install_other_error( await coresys.homeassistant.core.install() sleep.assert_awaited_once_with(30) - assert "Error on Home Assistant installation. Retry in 30sec" in caplog.text + assert "Error on Home Assistant installation. Retrying in 30sec" in caplog.text capture_exception.assert_called_once_with(err)