Remove unhealthy after failed update on startup (#5412)

This commit is contained in:
Mike Degatano 2024-11-14 03:41:47 -05:00 committed by GitHub
parent 687d7652a0
commit a8e7bb670e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 12 deletions

View File

@ -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:
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)

View File

@ -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