From 2a4890e2b0181487f0d468818a4492c3caecffd7 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 09:39:06 +0100 Subject: [PATCH] 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] * Update to new timeout configuration * Fix pytest failure --------- Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Mike Degatano Co-authored-by: Stefan Agner --- requirements.txt | 2 +- supervisor/docker/manager.py | 10 +++++----- tests/api/test_supervisor.py | 2 +- tests/docker/test_manager.py | 10 +++++----- tests/homeassistant/test_core.py | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/requirements.txt b/requirements.txt index f75019661..8121cd914 100644 --- a/requirements.txt +++ b/requirements.txt @@ -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 diff --git a/supervisor/docker/manager.py b/supervisor/docker/manager.py index be2be9abb..d201acac6 100644 --- a/supervisor/docker/manager.py +++ b/supervisor/docker/manager.py @@ -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 diff --git a/tests/api/test_supervisor.py b/tests/api/test_supervisor.py index ce3d3962c..0849b9f7b 100644 --- a/tests/api/test_supervisor.py +++ b/tests/api/test_supervisor.py @@ -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 ) diff --git a/tests/docker/test_manager.py b/tests/docker/test_manager.py index e288cc818..1a5993b6e 100644 --- a/tests/docker/test_manager.py +++ b/tests/docker/test_manager.py @@ -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 diff --git a/tests/homeassistant/test_core.py b/tests/homeassistant/test_core.py index e590ff987..5f0386dfd 100644 --- a/tests/homeassistant/test_core.py +++ b/tests/homeassistant/test_core.py @@ -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()