mirror of
https://github.com/home-assistant/supervisor.git
synced 2026-02-14 23:19:37 +00:00
Use query_dns instead of deprecated query after aiohttp 4.x update (#6478)
This commit is contained in:
@@ -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:
|
||||
|
||||
@@ -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,
|
||||
),
|
||||
):
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user