From 31ac0e7258cde81e114f1b2eaa5e0a5e2f743166 Mon Sep 17 00:00:00 2001 From: Florent Clarret Date: Mon, 6 Nov 2023 15:08:22 +0100 Subject: [PATCH] address --- dns_check/datadog_checks/dns_check/dns_check.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/dns_check/datadog_checks/dns_check/dns_check.py b/dns_check/datadog_checks/dns_check/dns_check.py index 75c779ebc1404..e6c7598e23a9b 100644 --- a/dns_check/datadog_checks/dns_check/dns_check.py +++ b/dns_check/datadog_checks/dns_check/dns_check.py @@ -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 @@ -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)