mirror of https://github.com/MISP/misp-modules
chg: [internal] Resolve deprecation warning in dbl_spamhaus
parent
f6d138dbd5
commit
1bd619914b
|
@ -50,7 +50,7 @@ def handler(q=False):
|
|||
return misperrors
|
||||
query = "{}.{}".format(requested_value, dbl)
|
||||
try:
|
||||
query_result = resolver.query(query, 'A')[0]
|
||||
query_result = resolver.resolve(query, 'A')[0]
|
||||
result = "{} - {}".format(requested_value, dbl_mapping[str(query_result)])
|
||||
except dns.resolver.NXDOMAIN as e:
|
||||
result = e.msg
|
||||
|
|
|
@ -198,7 +198,7 @@ class TestExpansions(unittest.TestCase):
|
|||
self.assertEqual(self.get_values(response), 'totalmateria.net - spam test domain')
|
||||
except Exception:
|
||||
try:
|
||||
self.assertTrue(self.get_values(response).startswith('None of DNS query names exist:'))
|
||||
self.assertTrue(self.get_values(response).startswith('The DNS query name does not exist:'))
|
||||
except Exception:
|
||||
self.assertEqual(self.get_errors(response), 'Not able to reach dbl.spamhaus.org or something went wrong')
|
||||
|
||||
|
|
Loading…
Reference in New Issue