Skip to content

Commit

Permalink
address
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorentClarret committed Nov 6, 2023
1 parent 1d75f2b commit 31ac0e7
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions dns_check/datadog_checks/dns_check/dns_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from typing import List, Optional # noqa: F401

import dns.resolver
from six import PY3

from datadog_checks.base import AgentCheck, ConfigurationError
from datadog_checks.base.utils.time import get_precise_time
Expand Down Expand Up @@ -79,9 +78,7 @@ def check(self, _):
raise AssertionError("Expected an NXDOMAIN, got a result.")
else:
answer = resolver.query(self.hostname, rdtype=self.record_type) # dns.resolver.Answer

items = list(answer.rrset.items.keys()) if PY3 else answer.rrset.items
assert any(it.to_text() for it in items)
assert any(it.to_text() for it in answer.rrset.items)

if self.resolves_as_ips:
self._check_answer(answer)
Expand Down

0 comments on commit 31ac0e7

Please sign in to comment.