mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-02-15 07:27:13 +00:00
Bump aiodocker from 0.24.0 to 0.25.0 (#6448)
* Bump aiodocker from 0.24.0 to 0.25.0 Bumps [aiodocker](https://github.com/aio-libs/aiodocker) from 0.24.0 to 0.25.0. - [Release notes](https://github.com/aio-libs/aiodocker/releases) - [Changelog](https://github.com/aio-libs/aiodocker/blob/main/CHANGES.rst) - [Commits](https://github.com/aio-libs/aiodocker/compare/v0.24.0...v0.25.0) --- updated-dependencies: - dependency-name: aiodocker dependency-version: 0.25.0 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> * Update to new timeout configuration * Fix pytest failure --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mike Degatano <michael.degatano@gmail.com> Co-authored-by: Stefan Agner <stefan@agner.ch>
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
aiodns==4.0.0
|
||||
aiodocker==0.24.0
|
||||
aiodocker==0.25.0
|
||||
aiohttp==3.13.3
|
||||
atomicwrites-homeassistant==1.4.1
|
||||
attrs==25.4.0
|
||||
|
||||
@@ -19,7 +19,7 @@ import aiodocker
|
||||
from aiodocker.containers import DockerContainer, DockerContainers
|
||||
from aiodocker.images import DockerImages
|
||||
from aiodocker.types import JSONObject
|
||||
from aiohttp import ClientSession, ClientTimeout, UnixConnector
|
||||
from aiohttp import ClientTimeout, UnixConnector
|
||||
import attr
|
||||
from awesomeversion import AwesomeVersion, AwesomeVersionCompareException
|
||||
from docker import errors as docker_errors
|
||||
@@ -268,8 +268,8 @@ class DockerAPI(CoreSysAttributes):
|
||||
self._dockerpy: DockerClient | None = None
|
||||
self.docker: aiodocker.Docker = aiodocker.Docker(
|
||||
url="unix://localhost", # dummy hostname for URL composition
|
||||
connector=(connector := UnixConnector(SOCKET_DOCKER.as_posix())),
|
||||
session=ClientSession(connector=connector, timeout=ClientTimeout(900)),
|
||||
connector=UnixConnector(SOCKET_DOCKER.as_posix()),
|
||||
timeout=ClientTimeout(900),
|
||||
api_version="auto",
|
||||
)
|
||||
|
||||
@@ -829,7 +829,7 @@ class DockerAPI(CoreSysAttributes):
|
||||
if container_metadata["State"]["Status"] == "running":
|
||||
_LOGGER.info("Stopping %s application", name)
|
||||
with suppress(aiodocker.DockerError):
|
||||
await docker_container.stop(timeout=timeout)
|
||||
await docker_container.stop(t=timeout)
|
||||
|
||||
if remove_container:
|
||||
with suppress(aiodocker.DockerError):
|
||||
@@ -874,7 +874,7 @@ class DockerAPI(CoreSysAttributes):
|
||||
|
||||
_LOGGER.info("Restarting %s", name)
|
||||
try:
|
||||
await container.restart(timeout=timeout)
|
||||
await container.restart(t=timeout)
|
||||
except aiodocker.DockerError as err:
|
||||
raise DockerError(f"Can't restart {name}: {err}", _LOGGER.warning) from err
|
||||
|
||||
|
||||
@@ -446,6 +446,6 @@ async def test_supervisor_api_stats_failure(
|
||||
assert body["error_key"] == "supervisor_unknown_error"
|
||||
assert body["extra_fields"] == {"logs_command": "ha supervisor logs"}
|
||||
assert (
|
||||
"Could not inspect container 'hassio_supervisor': DockerError(500, 'fail')"
|
||||
"Could not inspect container 'hassio_supervisor': [500] {'message': 'fail'}"
|
||||
in caplog.text
|
||||
)
|
||||
|
||||
@@ -131,7 +131,7 @@ async def test_run_command_inspect_error_propagates(docker: DockerAPI):
|
||||
async def test_run_command_docker_exception(docker: DockerAPI):
|
||||
"""Test command execution when Docker raises an exception."""
|
||||
# Mock docker containers.run to raise aiodocker.DockerError
|
||||
docker.containers.create.side_effect = aiodocker.DockerError(
|
||||
docker.containers.create.side_effect = err = aiodocker.DockerError(
|
||||
HTTPStatus.INTERNAL_SERVER_ERROR, {"message": "Docker error"}
|
||||
)
|
||||
|
||||
@@ -139,7 +139,7 @@ async def test_run_command_docker_exception(docker: DockerAPI):
|
||||
with pytest.raises(
|
||||
DockerError,
|
||||
match=re.escape(
|
||||
"Can't execute command: Can't create container from alpine:latest: DockerError(500, 'Docker error')"
|
||||
f"Can't execute command: Can't create container from alpine:latest: {str(err)}"
|
||||
),
|
||||
):
|
||||
await docker.run_command(image="alpine", command="test")
|
||||
@@ -335,7 +335,7 @@ async def test_stop_container_with_cidfile_cleanup(
|
||||
await docker.stop_container(timeout=10, remove_container=True, name=container_name)
|
||||
|
||||
# Verify container operations
|
||||
container.stop.assert_called_once_with(timeout=10)
|
||||
container.stop.assert_called_once_with(t=10)
|
||||
container.delete.assert_called_once_with(force=True, v=True)
|
||||
|
||||
assert not cidfile_path.exists()
|
||||
@@ -356,7 +356,7 @@ async def test_stop_container_without_removal_no_cidfile_cleanup(
|
||||
await docker.stop_container(container_name, timeout=10, remove_container=False)
|
||||
|
||||
# Verify container operations
|
||||
container.stop.assert_called_once_with(timeout=10)
|
||||
container.stop.assert_called_once_with(t=10)
|
||||
container.delete.assert_not_called()
|
||||
|
||||
# Verify cidfile cleanup was NOT called
|
||||
@@ -389,7 +389,7 @@ async def test_cidfile_cleanup_handles_oserror(
|
||||
await docker.stop_container(container_name, timeout=10, remove_container=True)
|
||||
|
||||
# Verify container operations completed
|
||||
container.stop.assert_called_once_with(timeout=10)
|
||||
container.stop.assert_called_once_with(t=10)
|
||||
container.delete.assert_called_once_with(force=True, v=True)
|
||||
|
||||
# Verify cidfile cleanup was attempted
|
||||
|
||||
@@ -296,7 +296,7 @@ async def test_stop(coresys: CoreSys, container: DockerContainer, exists: bool):
|
||||
|
||||
container.delete.assert_not_called()
|
||||
if exists:
|
||||
container.stop.assert_called_once_with(timeout=260)
|
||||
container.stop.assert_called_once_with(t=260)
|
||||
else:
|
||||
container.stop.assert_not_called()
|
||||
|
||||
@@ -307,7 +307,7 @@ async def test_restart(coresys: CoreSys, container: DockerContainer):
|
||||
await coresys.homeassistant.core.restart()
|
||||
block_till_run.assert_called_once()
|
||||
|
||||
container.restart.assert_called_once_with(timeout=260)
|
||||
container.restart.assert_called_once_with(t=260)
|
||||
container.stop.assert_not_called()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user