mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-07-25 18:16:32 +00:00
parent
dfdd0d6b4b
commit
2b082b362d
@ -65,7 +65,7 @@ class HaCli(CoreSysAttributes, JsonConfig):
|
|||||||
|
|
||||||
await self.instance.attach(tag=self.version)
|
await self.instance.attach(tag=self.version)
|
||||||
except DockerAPIError:
|
except DockerAPIError:
|
||||||
_LOGGER.info("No Audio plugin Docker image %s found.", self.instance.image)
|
_LOGGER.info("No cli plugin Docker image %s found.", self.instance.image)
|
||||||
|
|
||||||
# Install cli
|
# Install cli
|
||||||
with suppress(CliError):
|
with suppress(CliError):
|
||||||
@ -89,7 +89,7 @@ class HaCli(CoreSysAttributes, JsonConfig):
|
|||||||
|
|
||||||
if self.latest_version:
|
if self.latest_version:
|
||||||
with suppress(DockerAPIError):
|
with suppress(DockerAPIError):
|
||||||
await self.instance.install(self.latest_version)
|
await self.instance.install(self.latest_version, latest=True)
|
||||||
break
|
break
|
||||||
_LOGGER.warning("Error on install cli plugin. Retry in 30sec")
|
_LOGGER.warning("Error on install cli plugin. Retry in 30sec")
|
||||||
await asyncio.sleep(30)
|
await asyncio.sleep(30)
|
||||||
@ -111,10 +111,16 @@ class HaCli(CoreSysAttributes, JsonConfig):
|
|||||||
except DockerAPIError:
|
except DockerAPIError:
|
||||||
_LOGGER.error("HA cli update fails")
|
_LOGGER.error("HA cli update fails")
|
||||||
raise CliUpdateError() from None
|
raise CliUpdateError() from None
|
||||||
else:
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
with suppress(DockerAPIError):
|
with suppress(DockerAPIError):
|
||||||
await self.instance.cleanup()
|
await self.instance.cleanup()
|
||||||
|
|
||||||
|
self.version = version
|
||||||
|
self.save_data()
|
||||||
|
|
||||||
|
# Start cli
|
||||||
|
await self.start()
|
||||||
|
|
||||||
async def start(self) -> None:
|
async def start(self) -> None:
|
||||||
"""Run cli."""
|
"""Run cli."""
|
||||||
|
@ -165,15 +165,16 @@ class CoreDNS(JsonConfig, CoreSysAttributes):
|
|||||||
_LOGGER.warning("Version %s is already installed for CoreDNS", version)
|
_LOGGER.warning("Version %s is already installed for CoreDNS", version)
|
||||||
return
|
return
|
||||||
|
|
||||||
|
# Update
|
||||||
try:
|
try:
|
||||||
await self.instance.update(version)
|
await self.instance.update(version)
|
||||||
except DockerAPIError:
|
except DockerAPIError:
|
||||||
_LOGGER.error("CoreDNS update fails")
|
_LOGGER.error("CoreDNS update fails")
|
||||||
raise CoreDNSUpdateError() from None
|
raise CoreDNSUpdateError() from None
|
||||||
else:
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
with suppress(DockerAPIError):
|
with suppress(DockerAPIError):
|
||||||
await self.instance.cleanup()
|
await self.instance.cleanup()
|
||||||
|
|
||||||
self.version = version
|
self.version = version
|
||||||
self.save_data()
|
self.save_data()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user