Fix issue with mark system wrong as rollback (#2345)

This commit is contained in:
Pascal Vizeli 2020-12-05 11:19:27 +01:00 committed by GitHub
parent 1d43236211
commit dee2998ee3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,19 +66,26 @@ class Core(CoreSysAttributes):
await self.sys_resolution.evaluate.evaluate_system() await self.sys_resolution.evaluate.evaluate_system()
# Check supervisor version/update # Check supervisor version/update
if self.sys_dev: if self.sys_config.version == self.sys_supervisor.version:
self.sys_config.version = self.sys_supervisor.version return
elif self.sys_config.version != self.sys_supervisor.version:
self.sys_resolution.create_issue( # Somethings going wrong
IssueType.UPDATE_ROLLBACK, ContextType.SUPERVISOR
)
self.sys_resolution.unhealthy = UnhealthyReason.SUPERVISOR
_LOGGER.error( _LOGGER.error(
"Update '%s' of Supervisor '%s' failed!", "Update '%s' of Supervisor '%s' failed!",
self.sys_config.version, self.sys_config.version,
self.sys_supervisor.version, self.sys_supervisor.version,
) )
if self.sys_supervisor.need_update:
self.sys_resolution.create_issue(
IssueType.UPDATE_ROLLBACK, ContextType.SUPERVISOR
)
self.sys_resolution.unhealthy = UnhealthyReason.SUPERVISOR
# Fix wrong version in config / avoid boot loop on OS
self.sys_config.version = self.sys_supervisor.version
self.sys_config.save_data()
async def setup(self): async def setup(self):
"""Start setting up supervisor orchestration.""" """Start setting up supervisor orchestration."""
self.state = CoreState.SETUP self.state = CoreState.SETUP