script: fix deprecation warning in makeseeds.py

makeseeds.py:139: DeprecationWarning: please use dns.resolver.resolve() instead
  asn = int([x.to_text() for x in dns.resolver.query('.'.join(

per https://dnspython.readthedocs.io/en/latest/whatsnew.html
dns.resolver.query() was deprecated in dnspython version 2.0.0
pull/20288/head
Jon Atack 4 years ago
parent b6a00e76ab
commit dd7b5f46d8
No known key found for this signature in database
GPG Key ID: 4F5721B3D0E3921D

@ -135,7 +135,7 @@ def lookup_asn(net, ip):
ipaddr = res.rstrip('.') # 2.0.0.1.4.8.6.0.b.0.0.2.0.0.2.3
prefix = '.origin6'
asn = int([x.to_text() for x in dns.resolver.query('.'.join(
asn = int([x.to_text() for x in dns.resolver.resolve('.'.join(
reversed(ipaddr.split('.'))) + prefix + '.asn.cymru.com',
'TXT').response.answer][0].split('\"')[1].split(' ')[0])
return asn

Loading…
Cancel
Save