From 7d4866234f0bfbd6236967b508f5735c4319b7c0 Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Thu, 21 May 2020 12:00:52 +0200 Subject: [PATCH] Replace Logger.fatal by Logger.critical (#1734) --- supervisor/api/__init__.py | 2 +- supervisor/bootstrap.py | 10 +++++----- supervisor/core.py | 6 ++++-- supervisor/homeassistant.py | 2 +- supervisor/hwmon.py | 2 +- supervisor/misc/scheduler.py | 2 +- supervisor/supervisor.py | 2 +- 7 files changed, 14 insertions(+), 12 deletions(-) diff --git a/supervisor/api/__init__.py b/supervisor/api/__init__.py index b4bfe0c45..0953d77e4 100644 --- a/supervisor/api/__init__.py +++ b/supervisor/api/__init__.py @@ -380,7 +380,7 @@ class RestAPI(CoreSysAttributes): try: await self._site.start() except OSError as err: - _LOGGER.fatal("Failed to create HTTP server at 0.0.0.0:80 -> %s", err) + _LOGGER.critical("Failed to create HTTP server at 0.0.0.0:80 -> %s", err) else: _LOGGER.info("Start API on %s", self.sys_docker.network.supervisor) diff --git a/supervisor/bootstrap.py b/supervisor/bootstrap.py index 74bbcfc1d..c4e52e55e 100644 --- a/supervisor/bootstrap.py +++ b/supervisor/bootstrap.py @@ -214,27 +214,27 @@ def check_environment() -> None: try: os.environ[key] except KeyError: - _LOGGER.fatal("Can't find %s in env!", key) + _LOGGER.critical("Can't find %s in env!", key) # Check Machine info if not os.environ.get(ENV_HOMEASSISTANT_REPOSITORY) and not os.environ.get( ENV_SUPERVISOR_MACHINE ): - _LOGGER.fatal("Can't find any kind of machine/homeassistant details!") + _LOGGER.critical("Can't find any kind of machine/homeassistant details!") elif not os.environ.get(ENV_SUPERVISOR_MACHINE): _LOGGER.info("Use the old homeassistant repository for machine extraction") # check docker socket if not SOCKET_DOCKER.is_socket(): - _LOGGER.fatal("Can't find Docker socket!") + _LOGGER.critical("Can't find Docker socket!") # check socat exec if not shutil.which("socat"): - _LOGGER.fatal("Can't find socat!") + _LOGGER.critical("Can't find socat!") # check socat exec if not shutil.which("gdbus"): - _LOGGER.fatal("Can't find gdbus!") + _LOGGER.critical("Can't find gdbus!") def reg_signal(loop): diff --git a/supervisor/core.py b/supervisor/core.py index 00406fad9..db2928f5b 100644 --- a/supervisor/core.py +++ b/supervisor/core.py @@ -39,7 +39,9 @@ class Core(CoreSysAttributes): and self.sys_config.version != self.sys_supervisor.version ): self.healthy = False - _LOGGER.fatal("System running in a unhealthy state. Please update you OS!") + _LOGGER.critical( + "System running in a unhealthy state. Please update you OS!" + ) async def setup(self): """Setup supervisor orchestration.""" @@ -106,7 +108,7 @@ class Core(CoreSysAttributes): else: await self.sys_supervisor.update() except SupervisorUpdateError: - _LOGGER.fatal( + _LOGGER.critical( "Can't update supervisor! This will break some Add-ons or affect " "future version of Home Assistant!" ) diff --git a/supervisor/homeassistant.py b/supervisor/homeassistant.py index 4a863ca38..d1c6aede9 100644 --- a/supervisor/homeassistant.py +++ b/supervisor/homeassistant.py @@ -356,7 +356,7 @@ class HomeAssistant(JsonConfig, CoreSysAttributes): # Update going wrong, revert it if self.error_state and rollback: - _LOGGER.fatal("HomeAssistant update fails -> rollback!") + _LOGGER.critical("HomeAssistant update fails -> rollback!") await _update(rollback) else: raise HomeAssistantUpdateError() diff --git a/supervisor/hwmon.py b/supervisor/hwmon.py index 13b7baf3c..d0abb7960 100644 --- a/supervisor/hwmon.py +++ b/supervisor/hwmon.py @@ -28,7 +28,7 @@ class HwMonitor(CoreSysAttributes): self.monitor = pyudev.Monitor.from_netlink(self.context) self.observer = pyudev.MonitorObserver(self.monitor, self._udev_events) except OSError: - _LOGGER.fatal("Not privileged to run udev monitor!") + _LOGGER.critical("Not privileged to run udev monitor!") else: self.observer.start() _LOGGER.info("Started Supervisor hardware monitor") diff --git a/supervisor/misc/scheduler.py b/supervisor/misc/scheduler.py index 655a8c31b..0fd422b2b 100644 --- a/supervisor/misc/scheduler.py +++ b/supervisor/misc/scheduler.py @@ -64,7 +64,7 @@ class Scheduler: job = self.loop.call_at(calc.timestamp(), self._run_task, task_id) else: - _LOGGER.fatal( + _LOGGER.critical( "Unknown interval %s (type: %s) for scheduler %s", interval, type(interval), diff --git a/supervisor/supervisor.py b/supervisor/supervisor.py index 27cc4e484..2fcc7bfee 100644 --- a/supervisor/supervisor.py +++ b/supervisor/supervisor.py @@ -36,7 +36,7 @@ class Supervisor(CoreSysAttributes): try: await self.instance.attach(tag="latest") except DockerAPIError: - _LOGGER.fatal("Can't setup Supervisor Docker container!") + _LOGGER.critical("Can't setup Supervisor Docker container!") with suppress(DockerAPIError): await self.instance.cleanup()