mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-28 03:26:32 +00:00
Remove unhealthy after failed update on startup (#5412)
This commit is contained in:
parent
687d7652a0
commit
a8e7bb670e
@ -208,19 +208,12 @@ class Core(CoreSysAttributes):
|
||||
|
||||
# On release channel, try update itself if auto update enabled
|
||||
if self.sys_supervisor.need_update and self.sys_updater.auto_update:
|
||||
try:
|
||||
if not self.healthy:
|
||||
_LOGGER.warning("Ignoring Supervisor updates!")
|
||||
else:
|
||||
if not self.healthy:
|
||||
_LOGGER.warning("Ignoring Supervisor updates!")
|
||||
else:
|
||||
with suppress(SupervisorUpdateError):
|
||||
await self.sys_supervisor.update()
|
||||
return
|
||||
except SupervisorUpdateError as err:
|
||||
_LOGGER.critical(
|
||||
"Can't update Supervisor! This will break some Add-ons or affect "
|
||||
"future versions of Home Assistant!"
|
||||
)
|
||||
self.sys_resolution.unhealthy = UnhealthyReason.SUPERVISOR
|
||||
capture_exception(err)
|
||||
|
||||
# Start addon mark as initialize
|
||||
await self.sys_addons.boot(AddonStartup.INITIALIZE)
|
||||
|
@ -205,7 +205,7 @@ class Supervisor(CoreSysAttributes):
|
||||
)
|
||||
capture_exception(err)
|
||||
raise SupervisorUpdateError(
|
||||
f"Update of Supervisor failed: {err!s}", _LOGGER.error
|
||||
f"Update of Supervisor failed: {err!s}", _LOGGER.critical
|
||||
) from err
|
||||
|
||||
self.sys_config.version = version
|
||||
|
Loading…
x
Reference in New Issue
Block a user