Skip to content

Commit a8e7bb6

Browse files
authored
Remove unhealthy after failed update on startup (#5412)
1 parent 687d765 commit a8e7bb6

File tree

2 files changed

+5
-12
lines changed

2 files changed

+5
-12
lines changed

supervisor/core.py

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -208,19 +208,12 @@ async def start(self):
208208

209209
# On release channel, try update itself if auto update enabled
210210
if self.sys_supervisor.need_update and self.sys_updater.auto_update:
211-
try:
212-
if not self.healthy:
213-
_LOGGER.warning("Ignoring Supervisor updates!")
214-
else:
211+
if not self.healthy:
212+
_LOGGER.warning("Ignoring Supervisor updates!")
213+
else:
214+
with suppress(SupervisorUpdateError):
215215
await self.sys_supervisor.update()
216216
return
217-
except SupervisorUpdateError as err:
218-
_LOGGER.critical(
219-
"Can't update Supervisor! This will break some Add-ons or affect "
220-
"future versions of Home Assistant!"
221-
)
222-
self.sys_resolution.unhealthy = UnhealthyReason.SUPERVISOR
223-
capture_exception(err)
224217

225218
# Start addon mark as initialize
226219
await self.sys_addons.boot(AddonStartup.INITIALIZE)

supervisor/supervisor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ async def update(self, version: AwesomeVersion | None = None) -> None:
205205
)
206206
capture_exception(err)
207207
raise SupervisorUpdateError(
208-
f"Update of Supervisor failed: {err!s}", _LOGGER.error
208+
f"Update of Supervisor failed: {err!s}", _LOGGER.critical
209209
) from err
210210

211211
self.sys_config.version = version

0 commit comments

Comments
 (0)