diff --git a/reports/ipam-reports/dns-reports.py b/reports/ipam-reports/dns-reports.py index 9ae27b7..8377470 100644 --- a/reports/ipam-reports/dns-reports.py +++ b/reports/ipam-reports/dns-reports.py @@ -10,7 +10,7 @@ class Check_DNS_A_Record(Report): def test_dna_a_record(self): for device in Device.objects.filter(status=DeviceStatusChoices.STATUS_ACTIVE): - if device.interfaces is None: + if not device.interfaces.exists(): continue if device.name is None: self.log_info(device, "No device name") @@ -37,7 +37,7 @@ class Check_DNS_AAAA_Record(Report): def test_dns_aaaa_record(self): for device in Device.objects.filter(status=DeviceStatusChoices.STATUS_ACTIVE): - if device.interfaces is None: + if not device.interfaces.exists(): continue if device.name is None: self.log_info(device, "No device name") @@ -63,4 +63,4 @@ def test_dns_aaaa_record(self): except dns.resolver.NoAnswer: self.log_success(device) except dns.resolver.NXDOMAIN: - self.log_success(device) \ No newline at end of file + self.log_success(device)