1
0
mirror of https://github.com/home-assistant/supervisor.git synced 2026-02-15 07:27:13 +00:00

Use query_dns instead of deprecated query after aiohttp 4.x update (#6478)

This commit is contained in:
Jan Čermák
2026-01-14 15:22:12 +01:00
committed by GitHub
parent 753021d4d5
commit ec0f7c2b9c
4 changed files with 5 additions and 4 deletions

View File

@@ -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:

View File

@@ -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,
),
):

View File

@@ -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

View File

@@ -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