From ec0f7c2b9ca3de7793fbbbcefa5bba5b9820efda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= Date: Wed, 14 Jan 2026 15:22:12 +0100 Subject: [PATCH] Use query_dns instead of deprecated query after aiohttp 4.x update (#6478) --- supervisor/resolution/checks/dns_server.py | 3 ++- tests/resolution/check/test_check.py | 2 +- tests/resolution/check/test_check_dns_server_failure.py | 2 +- tests/resolution/check/test_check_dns_server_ipv6_error.py | 2 +- 4 files changed, 5 insertions(+), 4 deletions(-) diff --git a/supervisor/resolution/checks/dns_server.py b/supervisor/resolution/checks/dns_server.py index efd701124..c3e456300 100644 --- a/supervisor/resolution/checks/dns_server.py +++ b/supervisor/resolution/checks/dns_server.py @@ -22,7 +22,8 @@ async def check_server( """Check a DNS server and report issues.""" ip_addr = server[6:] if server.startswith("dns://") else server async with DNSResolver(loop=loop, nameservers=[ip_addr]) as resolver: - await resolver.query(DNS_CHECK_HOST, qtype) + # following call should be changed to resolver.query() in aiodns 5.x + await resolver.query_dns(DNS_CHECK_HOST, qtype) def setup(coresys: CoreSys) -> CheckBase: diff --git a/tests/resolution/check/test_check.py b/tests/resolution/check/test_check.py index 9793eb4dd..2339e98f7 100644 --- a/tests/resolution/check/test_check.py +++ b/tests/resolution/check/test_check.py @@ -18,7 +18,7 @@ def fixture_mock_dns_query(): """Mock aiodns query.""" with ( patch( - "supervisor.resolution.checks.dns_server.DNSResolver.query", + "supervisor.resolution.checks.dns_server.DNSResolver.query_dns", new_callable=AsyncMock, ), ): diff --git a/tests/resolution/check/test_check_dns_server_failure.py b/tests/resolution/check/test_check_dns_server_failure.py index cdcbca939..9dfbf046d 100644 --- a/tests/resolution/check/test_check_dns_server_failure.py +++ b/tests/resolution/check/test_check_dns_server_failure.py @@ -15,7 +15,7 @@ from supervisor.resolution.const import ContextType, IssueType async def fixture_dns_query() -> AsyncMock: """Mock aiodns query.""" with patch( - "supervisor.resolution.checks.dns_server.DNSResolver.query", + "supervisor.resolution.checks.dns_server.DNSResolver.query_dns", new_callable=AsyncMock, ) as dns_query: yield dns_query diff --git a/tests/resolution/check/test_check_dns_server_ipv6_error.py b/tests/resolution/check/test_check_dns_server_ipv6_error.py index 3eefc106a..b55286868 100644 --- a/tests/resolution/check/test_check_dns_server_ipv6_error.py +++ b/tests/resolution/check/test_check_dns_server_ipv6_error.py @@ -15,7 +15,7 @@ from supervisor.resolution.const import ContextType, IssueType async def fixture_dns_query() -> AsyncMock: """Mock aiodns query.""" with patch( - "supervisor.resolution.checks.dns_server.DNSResolver.query", + "supervisor.resolution.checks.dns_server.DNSResolver.query_dns", new_callable=AsyncMock, ) as dns_query: yield dns_query