mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-25 18:16:32 +00:00
Change Supervisor update flow with AppArmor (#2529)
This commit is contained in:
parent
2a5d8a5c82
commit
a798a2466f
@ -125,6 +125,14 @@ class Supervisor(CoreSysAttributes):
|
||||
_LOGGER.warning("Version %s is already installed", version)
|
||||
return
|
||||
|
||||
# First update own AppArmor
|
||||
try:
|
||||
await self.update_apparmor()
|
||||
except SupervisorError as err:
|
||||
_LOGGER.critical("Abort update because of an issue with AppArmor!")
|
||||
raise SupervisorUpdateError() from err
|
||||
|
||||
# Update container
|
||||
_LOGGER.info("Update Supervisor to version %s", version)
|
||||
try:
|
||||
await self.instance.install(
|
||||
@ -144,8 +152,6 @@ class Supervisor(CoreSysAttributes):
|
||||
self.sys_config.version = version
|
||||
self.sys_config.save_data()
|
||||
|
||||
with suppress(SupervisorError):
|
||||
await self.update_apparmor()
|
||||
self.sys_create_task(self.sys_core.stop())
|
||||
|
||||
@Job(conditions=[JobCondition.RUNNING], on_condition=SupervisorJobError)
|
||||
|
Loading…
x
Reference in New Issue
Block a user