mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-07 17:26:32 +00:00
Enable connectivity on startup (#2879)
* Check connectivity on system startup * move it
This commit is contained in:
parent
d8d594c728
commit
b234c18664
@ -96,6 +96,9 @@ class Core(CoreSysAttributes):
|
||||
"""Start setting up supervisor orchestration."""
|
||||
self.state = CoreState.SETUP
|
||||
|
||||
# Check internet on startup
|
||||
await self.sys_supervisor.check_connectivity()
|
||||
|
||||
# Order can be important!
|
||||
setup_loads: List[Awaitable[None]] = [
|
||||
# rest api views
|
||||
@ -158,9 +161,6 @@ class Core(CoreSysAttributes):
|
||||
"System is running in an unhealthy state and needs manual intervention!"
|
||||
)
|
||||
|
||||
# Check internet on startup
|
||||
await self.sys_supervisor.check_connectivity()
|
||||
|
||||
# Mark booted partition as healthy
|
||||
await self.sys_hassos.mark_healthy()
|
||||
|
||||
|
@ -153,7 +153,6 @@ class Job(CoreSysAttributes):
|
||||
if (
|
||||
JobCondition.INTERNET_SYSTEM in self.conditions
|
||||
and not self.sys_supervisor.connectivity
|
||||
and self.sys_core.state in (CoreState.SETUP, CoreState.RUNNING)
|
||||
):
|
||||
raise JobConditionException(
|
||||
f"'{self._method.__qualname__}' blocked from execution, no supervisor internet connection"
|
||||
@ -163,7 +162,6 @@ class Job(CoreSysAttributes):
|
||||
JobCondition.INTERNET_HOST in self.conditions
|
||||
and self.sys_host.network.connectivity is not None
|
||||
and not self.sys_host.network.connectivity
|
||||
and self.sys_core.state in (CoreState.SETUP, CoreState.RUNNING)
|
||||
):
|
||||
raise JobConditionException(
|
||||
f"'{self._method.__qualname__}' blocked from execution, no host internet connection"
|
||||
|
@ -143,6 +143,7 @@ class PluginDns(PluginBase):
|
||||
|
||||
# Update supervisor
|
||||
self._write_resolv(HOST_RESOLV)
|
||||
await self.sys_supervisor.check_connectivity()
|
||||
|
||||
async def install(self) -> None:
|
||||
"""Install CoreDNS."""
|
||||
|
@ -241,7 +241,7 @@ class Supervisor(CoreSysAttributes):
|
||||
timeout = aiohttp.ClientTimeout(total=10)
|
||||
try:
|
||||
await self.sys_websession.head(
|
||||
"https://version.home-assistant.io/online.txt", timeout=timeout
|
||||
"http://version.home-assistant.io/online.txt", timeout=timeout
|
||||
)
|
||||
except (ClientError, asyncio.TimeoutError):
|
||||
self.connectivity = False
|
||||
|
Loading…
x
Reference in New Issue
Block a user